Re: [PATCH v3 7/9] gpiolib-sysfs: Add gpio name parsing for sysfs export

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

 



On Mon, Sep 21, 2015 at 06:09:15PM -0700, Linus Walleij wrote:
> On Fri, Aug 14, 2015 at 7:11 AM, Markus Pargmann <mpa@xxxxxxxxxxxxxx> wrote:
> 
> > Signed-off-by: Markus Pargmann <mpa@xxxxxxxxxxxxxx>
> 
> This has too terse commit description. I don't understand the patch or
> what it is supposed to do.

Sorry, indeed, this requires a commit description. I would add something
like this:

In '/sys/class/gpio/' GPIOs can be exported by using their GPIO number.
If the exported GPIO has a name, it will show up as a new directory in
'/sys/class/gpio/<GPIO_NAME>'. It is somehow inconsistent to use a
number for exporting and the name for accessing the GPIO.

This patch adds the possibility to use the GPIO name to export it. This
introduces a consistent behaviour for exporting and accessing a GPIO
from userspace.

The mechanism of parsing the GPIO name is a fallback mechanism. This
ensures backwards compatibility of the gpio interface. If the string
passed to '/sys/class/gpio/export' can not be parsed as number, it tries
to match a GPIO name. The same behaviour is implemented for the
'unexport' file.

The implementation uses the previously defined gpio_name_to_desc().



Thanks,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: Digital signature


[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