Re: [PATCH v2] gpiolib: Disallow identical line names in the same chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Flavio,

On Thu, Jan 7, 2021 at 2:49 PM Flavio Suligoi <f.suligoi@xxxxxxx> wrote:
> > On Wed, Jan 6, 2021 at 11:09 AM Bartosz Golaszewski
> > <bgolaszewski@xxxxxxxxxxxx> wrote:
> > > I can do it alright. But in the context of user-space I think this
> > > doesn't really change anything. DT users still can use non-unique
> > > names and libgpiod still has to account for that if the API is to be
> > > considered correct. Is this change really useful? How does it affect
> > > ACPI users that already define non-unique names?
> >
> > For hardware description instances the problem remains: device tree
> > line-names and device properties can be non-unique.
> >
> > What it solves is to enforce unique line names for gpio chips with
> > the struct gpio_chip .names array set to some names, that each
> > name in this array must be unique.
> >
> > This happens for example when two USB FTDI converters
> > with the same GPIO lines are plugged in. Each chip can have a
> > "TX" line but it can no longer have two "TX" lines.
> >
> > Yours,
> > Linus Walleij
>
> about the duplicate line names, what do you think
> about adding to the command "gpiofind" of libgpiod tools,
> the possibility to discover all the duplicate gpio lines?
>
> For example, something like the following:
>
> # gpiofind button_1
> gpiochip0 20
> gpiochip0 22 (duplicate)

This cannot happen, as the duplicate is on the same gpiochip.

> gpiochip2 12 (duplicate)
> #

I don't like the "(duplicate)" suffix.  It makes scripting harder (and
more unsafe).
What about outputting only the first one, unless "-a" is specified?

# gpiofind -a button_1
gpiochip0 20
gpiochip1 22
gpiochip2 12
#

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux