diff options
author | Johan Hovold <johan@kernel.org> | 2015-05-04 11:10:29 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-05-12 04:46:36 -0400 |
commit | cecf58ab551f746c1e2b549d90b51a94b442d1e0 (patch) | |
tree | 2e474cc54ad3a9071e50db25d731947b4d4fabf0 /drivers/gpio/gpiolib-sysfs.c | |
parent | 52176d0d3be29ccb01a44ee77532bb3969939ecf (diff) |
gpio: sysfs: preparatory clean ups
Put the recently introduced gpio-chip pointer to some more use in
gpiod_export.
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.c')
-rw-r--r-- | drivers/gpio/gpiolib-sysfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index b2b62cc6f9e1..658ed28e6d7d 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c | |||
@@ -599,7 +599,7 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change) | |||
599 | goto fail_unlock; | 599 | goto fail_unlock; |
600 | } | 600 | } |
601 | 601 | ||
602 | if (desc->chip->direction_input && desc->chip->direction_output && | 602 | if (chip->direction_input && chip->direction_output && |
603 | direction_may_change) { | 603 | direction_may_change) { |
604 | set_bit(FLAG_SYSFS_DIR, &desc->flags); | 604 | set_bit(FLAG_SYSFS_DIR, &desc->flags); |
605 | } | 605 | } |
@@ -607,10 +607,10 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change) | |||
607 | spin_unlock_irqrestore(&gpio_lock, flags); | 607 | spin_unlock_irqrestore(&gpio_lock, flags); |
608 | 608 | ||
609 | offset = gpio_chip_hwgpio(desc); | 609 | offset = gpio_chip_hwgpio(desc); |
610 | if (desc->chip->names && desc->chip->names[offset]) | 610 | if (chip->names && chip->names[offset]) |
611 | ioname = desc->chip->names[offset]; | 611 | ioname = chip->names[offset]; |
612 | 612 | ||
613 | dev = device_create_with_groups(&gpio_class, desc->chip->dev, | 613 | dev = device_create_with_groups(&gpio_class, chip->dev, |
614 | MKDEV(0, 0), desc, gpio_groups, | 614 | MKDEV(0, 0), desc, gpio_groups, |
615 | ioname ? ioname : "gpio%u", | 615 | ioname ? ioname : "gpio%u", |
616 | desc_to_gpio(desc)); | 616 | desc_to_gpio(desc)); |