Skip to content

Commit c789950

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
gpio: altera: Add missed base and label initialisations
During conversion driver to modern APIs the base field initial value of the GPIO chip was moved from -1 to 0, which triggers a warning. Add missed base initialisation as it was in the original code. Initialise the GPIO chip label correctly as it was done by of_mm_gpiochip_add_data() before the below mentioned change. Fixes: 50dded8 ("gpio: altera: Drop legacy-of-mm-gpiochip.h header") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20241118095402.516989-1-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 5bbed54 commit c789950

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpio/gpio-altera.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ static int altera_gpio_probe(struct platform_device *pdev)
261261
altera_gc->gc.set = altera_gpio_set;
262262
altera_gc->gc.owner = THIS_MODULE;
263263
altera_gc->gc.parent = &pdev->dev;
264+
altera_gc->gc.base = -1;
265+
266+
altera_gc->gc.label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev));
267+
if (!altera_gc->gc.label)
268+
return -ENOMEM;
264269

265270
altera_gc->regs = devm_platform_ioremap_resource(pdev, 0);
266271
if (IS_ERR(altera_gc->regs))

0 commit comments

Comments
 (0)