summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2015-08-14 14:11:01 (GMT)
committerLinus Walleij <linus.walleij@linaro.org>2015-09-24 17:48:52 (GMT)
commitddd5404007b8496f20ad2efe1147e102e6226634 (patch)
tree3166c9462ed73a7437313f0d97c6074bdb248c65
parent5f3ca7329b049b40667a190ddf14b69afdb91576 (diff)
downloadlinux-ddd5404007b8496f20ad2efe1147e102e6226634.tar.xz
gpio-sysfs: Use gpio descriptor name instead of gpiochip names array
The name is now stored in the gpio descriptor as well, for example to allow to store names from DT. This patch changes the sysfs gpio files to use the gpio descriptor name. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpiolib-sysfs.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index b57ed8e..3e81f28 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -550,9 +550,7 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
struct gpiod_data *data;
unsigned long flags;
int status;
- const char *ioname = NULL;
struct device *dev;
- int offset;
/* can't export until sysfs is available ... */
if (!gpio_class.p) {
@@ -601,13 +599,9 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
else
data->direction_can_change = false;
- offset = gpio_chip_hwgpio(desc);
- if (chip->names && chip->names[offset])
- ioname = chip->names[offset];
-
dev = device_create_with_groups(&gpio_class, chip->dev,
MKDEV(0, 0), data, gpio_groups,
- ioname ? ioname : "gpio%u",
+ desc->name ? desc->name : "gpio%u",
desc_to_gpio(desc));
if (IS_ERR(dev)) {
status = PTR_ERR(dev);