gpio: omap: Use device name as chip label

Since commit 92bf78b33b ("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@nod.at>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260811130310.3867697-1-richard@nod.at
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
This commit is contained in:
Richard Weinberger 2026-08-11 15:03:10 +02:00 committed by Bartosz Golaszewski
parent beb0556bcc
commit 3d12d02dda

View File

@ -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;
}