[PATCH 0/3] gpiolib: gpio naming in sysfs

Jani Nikula
2009-12-09T13:49:58Z

Hi David and Greg -

There's been debate in the past about naming gpios exported to the
sysfs. Long story short, there are users for that, and there are now
two ways of naming gpios in the sysfs: char **names in struct
gpio_chip [1], and gpio_export_link() [2].

This patchset combines these two by allowing gpio_export_link() to
have dev == NULL to make the link under gpiolib sysfs (instead of
arbitrary device), and to use gpio_chip names to create links (instead
of naming the actual devices with those). This gpio_export_link() with
dev == NULL would also be useful for gpios not associated with a
driver.

Greg, patch 1/3 introduces class_{create,remove}_link(), is that
acceptable?

CC Daniel, you introduced names in struct gpio_chip in the first
place, does this (especially patch 3/3) look acceptable to you?

BR,
Jani.

[1] commit 926b663ce8215ba448960e1ff6e58b67a2c3b99b
[2] commit a4177ee7f1a83eecb1d75e85d32664b023ef65e9

Artem Bityutskiy (1):
device class: add symlink creation helpers

Jani Nikula (2):
gpiolib: add support for having symlinks under gpio class directory
gpiolib: use chip->names for symlinks, always use gpioN for device
names

drivers/base/class.c | 21 ++++++++++
drivers/gpio/gpiolib.c | 101 +++++++++++++++++++++++++++++++++++++++++++++---
include/linux/device.h | 4 ++
3 files changed, 120 insertions(+), 6 deletions(-)