[PATCH] gpio: octeon: allocate the GPIO base dynamically

From: Orgad Shaneh

Date: Tue Oct 27 2026 - 02:02:28 EST


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@xxxxxxxxx>
---
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