From 3d12d02dda0917f50fcc4cdf4b54bb417f609d78 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Tue, 11 Aug 2026 15:03:10 +0200 Subject: [PATCH] gpio: omap: Use device name as chip label 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 Reviewed-by: Linus Walleij Link: https://patch.msgid.link/20260811130310.3867697-1-richard@nod.at Signed-off-by: Bartosz Golaszewski --- 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 005420baecf4..a9b9a3d9631e 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1032,8 +1032,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; /* @@ -1055,11 +1053,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; @@ -1086,9 +1080,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; }