linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-gpio <linux-gpio@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpiolib: Document that GPIO line names are not globally unique
Date: Sat, 16 May 2020 11:41:30 +0200	[thread overview]
Message-ID: <CACRpkdaJk2G8MF6UMVSc2LdFPdpm9L2hox3c-rxD6RhyMg_25Q@mail.gmail.com> (raw)
In-Reply-To: <CAMpxmJXD9WgrFnKvS2a=iOCVuYiqdTGwp+r2BjOv2RJH2R=s1Q@mail.gmail.com>

On Tue, May 12, 2020 at 12:43 PM Bartosz Golaszewski
<bgolaszewski@baylibre.com> wrote:
> pon., 11 maj 2020 o 12:18 Geert Uytterhoeven <geert+renesas@glider.be>
> napisał(a):
> >
> > gpiochip_set_desc_names() no longer rejects GPIO line name collisions.
> > Hence GPIO line names are not guaranteed to be globally unique.
> > In case of multiple GPIO lines with the same name, gpio_name_to_desc()
> > will return the first match found.
(...)
> This makes me wonder whether I should do something about this in
> libgpiod? Looks to me like gpiod_chip_find_line() and the global
> gpiod_line_find() are no longer reliable and should probably return
> all lines whose names match.

Hm. You probably know how consumers of libgpiod work better than me.

The background is historical and this happens because gpiolib had a
mechanism to name lines before I even took over maintenance, and
that did not require line names to be unique. So
when I created the character device I had to face the fact.

We also had to deal with the fact that when naming lines, the
"NULL alternative" (no name on the line at all) is always a valid
fallback.

And all lines named NULL are still valid and all have the same name
so...

Yours,
Linus Walleij

  reply	other threads:[~2020-05-16  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 10:18 [PATCH] gpiolib: Document that GPIO line names are not globally unique Geert Uytterhoeven
2020-05-12 10:43 ` Bartosz Golaszewski
2020-05-16  9:41   ` Linus Walleij [this message]
2020-05-16  9:37 ` Linus Walleij

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=CACRpkdaJk2G8MF6UMVSc2LdFPdpm9L2hox3c-rxD6RhyMg_25Q@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=geert+renesas@glider.be \
    --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;
as well as URLs for NNTP newsgroup(s).