[PATCH] gpio: omap: Use device name as chip label
From: Richard Weinberger
Date: Tue Aug 11 2026 - 09:08:38 EST
Since commit 92bf78b33b0b4 ("gpio: omap: use dynamic allocation of base"),
the driver no longer statically allocates the gpio base.
Having chip labels with the old static allocation makes no sense anymore.
Use the device name to have a unique name such that gpiod users can cleary
distinguish between gpio chips.
Signed-off-by: Richard Weinberger <richard@xxxxxx>
---
drivers/gpio/gpio-omap.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index e39723b5901b..3fed7b1bebf3 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1033,8 +1033,6 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
static int omap_gpio_chip_init(struct gpio_bank *bank, struct device *pm_dev)
{
struct gpio_irq_chip *irq;
- static int gpio;
- const char *label;
int ret;
/*
@@ -1056,11 +1054,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct device *pm_dev)
if (bank->regs->wkup_en)
bank->chip.parent = &omap_mpuio_device.dev;
} else {
- label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d",
- gpio, gpio + bank->width - 1);
- if (!label)
- return -ENOMEM;
- bank->chip.label = label;
+ bank->chip.label = dev_name(bank->chip.parent);
}
bank->chip.base = -1;
bank->chip.ngpio = bank->width;
@@ -1087,9 +1081,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct device *pm_dev)
if (ret)
gpiochip_remove(&bank->chip);
- if (!bank->is_mpuio)
- gpio += bank->width;
-
return ret;
}
--
2.51.0