[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53D26537.9000203@roeck-us.net>
Date: Fri, 25 Jul 2014 07:09:59 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: jiri.prchal@...ignal.cz, Alexandre Courbot <gnurou@...il.com>
CC: "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [RFC PATCH] gpiolib: Provide and export gpiod_export_name
On 07/25/2014 12:46 AM, Jiří Prchal wrote:
> What about this modification? If is defined label, use it prioritlly, at second use name in chip description.
>
> @@ -842,7 +842,9 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
> spin_unlock_irqrestore(&gpio_lock, flags);
>
> offset = gpio_chip_hwgpio(desc);
> - if (desc->chip->names && desc->chip->names[offset])
> + if (desc->label)
> + ioname = desc->label;
> + else if (desc->chip->names && desc->chip->names[offset])
> ioname = desc->chip->names[offset];
>
Label is not unique. It is, for example, used by the sysfs export function,
and all pins exported from user space have the same label. The first
pin exported through sysfs would be named "sysfs", the second export
would fail.
Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists