mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Orgad Shaneh <orgads@gmail.com>
To: linusw@kernel.org, brgl@kernel.org
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] gpio: octeon: allocate the GPIO base dynamically
Date: Tue, 27 Oct 2026 06:02:21 +0000	[thread overview]
Message-ID: <20261027060221.2687941-1-orgads@gmail.com> (raw)

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


             reply	other threads:[~2026-10-27  6:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27  6:02 Orgad Shaneh [this message]
2026-10-28  9:46 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261027060221.2687941-1-orgads@gmail.com \
    --to=orgads@gmail.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®