diff mbox series

[2/2] gpio: sunxi: Remove the sunxi_name_to_gpio_bank function

Message ID 20210912152837.47662-2-samuel@sholland.org
State Accepted
Commit 14c8c631e986d350ce468ae5d627f547e5a4e1aa
Delegated to: Andre Przywara
Headers show
Series [1/2] sunxi: Simplify MMC pinmux selection | expand

Commit Message

Samuel Holland Sept. 12, 2021, 3:28 p.m. UTC
The only caller of this function was the MMC pinmux code, which used it
to parse a string given from a Kconfig symbol. As the Kconfig symbol has
been converted to a Boolean, this function is no longer needed.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 arch/arm/include/asm/arch-sunxi/gpio.h |  1 -
 drivers/gpio/sunxi_gpio.c              | 14 --------------
 2 files changed, 15 deletions(-)

Comments

Simon Glass Sept. 30, 2021, 4:08 a.m. UTC | #1
On Sun, 12 Sept 2021 at 09:28, Samuel Holland <samuel@sholland.org> wrote:
>
> The only caller of this function was the MMC pinmux code, which used it
> to parse a string given from a Kconfig symbol. As the Kconfig symbol has
> been converted to a Boolean, this function is no longer needed.
>
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>
>  arch/arm/include/asm/arch-sunxi/gpio.h |  1 -
>  drivers/gpio/sunxi_gpio.c              | 14 --------------
>  2 files changed, 15 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
index 43b1b97391a..c595dcc6351 100644
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -238,7 +238,6 @@  int sunxi_gpio_get_cfgbank(struct sunxi_gpio *pio, int bank_offset);
 int sunxi_gpio_get_cfgpin(u32 pin);
 int sunxi_gpio_set_drv(u32 pin, u32 val);
 int sunxi_gpio_set_pull(u32 pin, u32 val);
-int sunxi_name_to_gpio_bank(const char *name);
 int sunxi_name_to_gpio(const char *name);
 #define name_to_gpio(name) sunxi_name_to_gpio(name)
 
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index 24cb604e3e3..c5d73d0a049 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -118,20 +118,6 @@  int sunxi_name_to_gpio(const char *name)
 }
 #endif /* DM_GPIO */
 
-int sunxi_name_to_gpio_bank(const char *name)
-{
-	int group = 0;
-
-	if (*name == 'P' || *name == 'p')
-		name++;
-	if (*name >= 'A') {
-		group = *name - (*name > 'a' ? 'a' : 'A');
-		return group;
-	}
-
-	return -1;
-}
-
 #if CONFIG_IS_ENABLED(DM_GPIO)
 /* TODO(sjg@chromium.org): Remove this function and use device tree */
 int sunxi_name_to_gpio(const char *name)