gpio: octeon: allocate the GPIO base dynamically
PATCH 1/1 gpio: octeon: allocate the GPIO base dynamically
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.
---
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(-)
drivers/gpio/gpio-octeon.c +1 -1
@@ -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;
Signature · 1 line
2.53.0
Bartosz Golaszewski
AppliedQuoted 5 lines · Orgad Shaneh
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.
Quoted 7 lines
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.
[...]
Applied, thanks!
[1/1] gpio: octeon: allocate the GPIO base dynamically
https://git.kernel.org/brgl/c/dd2ad62e78990087bb62864ae76e7c2251fe5b90
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>