From: "Arnd Bergmann" <arnd@arndb.de>
To: "Geert Uytterhoeven" <geert@linux-m68k.org>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
"Linus Walleij" <linusw@kernel.org>,
"Bartosz Golaszewski" <brgl@kernel.org>,
"Marcel Holtmann" <marcel@holtmann.org>,
"MyungJoo Ham" <myungjoo.ham@samsung.com>,
"Chanwoo Choi" <cw00.choi@samsung.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Andy Shevchenko" <andy@kernel.org>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Ulf Hansson" <ulfh@kernel.org>,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
dri-devel@lists.freedesktop.org, linux-i2c@vger.kernel.org,
linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
"linux-mmc @ vger . kernel . org" <linux-mmc@vger.kernel.org>,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH] [RFC] gpiolib: introduce gpio_name() helper
Date: Wed, 01 Jul 2026 10:31:37 +0200 [thread overview]
Message-ID: <72746bd8-8ba3-4369-a2e9-60795f183813@app.fastmail.com> (raw)
In-Reply-To: <CAMuHMdWhv8i6tkmOJU_ee9LAV7mMcQHe9FXgqTHCjGiEMWvn8Q@mail.gmail.com>
On Tue, Jun 30, 2026, at 18:01, Geert Uytterhoeven wrote:
> On Mon, 29 Jun 2026 at 19:54, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Mon, Jun 29, 2026, at 17:29, Geert Uytterhoeven wrote:
>> > Same results for instantiation using sysfs or configfs[1], although
>> > the latter does have optional support for specifying the name.
>>
>> I wonder how many of the other instances have the same problem
>> then. Would it be appropriate for gpiochip_fwd_desc_add() to set
>> a name itself to address this one?
>
> I don't think it would be appropriate for the GPIO aggregator to set
> that name. What we want to print here (for debugging) is the physical
> GPIO that an aggregator's GPIO is mapped to, not some consumer or line
> name (which is not guaranteed to be unique).
Ok.
> E.g. "<chip-name>.<offset>" would be fine. As gpiod_name() can only
> return a fixed string or an existing string, it can't return such a
> formatted string, though. And consumers don't have access to chip info?
The gpiod_hwgpio() function is exported to consumers, so they can
already print that instead of desc_to_gpio() if the local number
is sufficient. If we really care about the <chip-name> portion for
any of the debug prints, we could export another function that
returns maybe gpiod_to_chip(gpiod)->label or
dev_name(&gpiod_to_gpio_device(gpiod)->dev), which are both
constant strings we can print.
It looks like we can also replace most of the remaining callers
of desc_to_gpio() with gpiod_hwgpio().
Arnd
prev parent reply other threads:[~2026-07-01 8:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 13:56 [PATCH] [RFC] gpiolib: introduce gpio_name() helper Arnd Bergmann
2026-06-29 14:10 ` sashiko-bot
2026-06-29 15:23 ` Andy Shevchenko
2026-06-29 15:45 ` Arnd Bergmann
2026-06-29 15:29 ` Geert Uytterhoeven
2026-06-29 15:48 ` Arnd Bergmann
2026-06-30 16:01 ` Geert Uytterhoeven
2026-07-01 8:31 ` Arnd Bergmann [this message]
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=72746bd8-8ba3-4369-a2e9-60795f183813@app.fastmail.com \
--to=arnd@arndb.de \
--cc=andy@kernel.org \
--cc=arnd@kernel.org \
--cc=brgl@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=myungjoo.ham@samsung.com \
--cc=ulfh@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