mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: octeon: allocate the GPIO base dynamically
@ 2026-10-27  6:02 Orgad Shaneh
  2026-10-28  9:46 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Orgad Shaneh @ 2026-10-27  6:02 UTC (permalink / raw)
  To: linusw, brgl; +Cc: linux-gpio, linux-kernel

The driver registers its chip with base 0, which gpiolib reports on
every boot:

  gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.

Nothing needs the fixed numbers. The only in-tree consumers, the
gpio-leds nodes of the D-Link DSR boards, reference the controller by
phandle; the GPIO interrupts go through the octeon-irq domain; and no
board code uses the legacy integer API. Let gpiolib pick the base. Only
the chip's number in the deprecated sysfs interface changes.

Assisted-by: LLM
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
Tested on a CN6335 board, in a 7.3-based tree: the warning is gone and
the chip probes as before.

 drivers/gpio/gpio-octeon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-octeon.c b/drivers/gpio/gpio-octeon.c
index 777e20c608dc..5fa4825d1a96 100644
--- a/drivers/gpio/gpio-octeon.c
+++ b/drivers/gpio/gpio-octeon.c
@@ -102,7 +102,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
 	chip->label = "octeon-gpio";
 	chip->parent = &pdev->dev;
 	chip->owner = THIS_MODULE;
-	chip->base = 0;
+	chip->base = -1;
 	chip->can_sleep = false;
 	chip->ngpio = 20;
 	chip->direction_input = octeon_gpio_dir_in;
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-28  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27  6:02 [PATCH] gpio: octeon: allocate the GPIO base dynamically Orgad Shaneh
2026-10-28  9:46 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®