aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-02-09 13:21:06 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-02-11 18:16:54 +0100
commitafbc4f312b5e6e87fcd383eb6764e09f1324c78e (patch)
tree5428e0fe100c576dd158bba68df183010cee2009 /drivers/gpio/gpiolib.c
parentgpio: remember to finally free gpio_device (diff)
downloadlinux-dev-afbc4f312b5e6e87fcd383eb6764e09f1324c78e.tar.xz
linux-dev-afbc4f312b5e6e87fcd383eb6764e09f1324c78e.zip
gpio: move sysfs mock device to the gpio_device
Since gpio_device is the struct that survives if the backing gpio_chip is removed, move the sysfs mock device to this state container so it becomes part of the dangling state of the GPIO device on removal. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 36f8be3f910b..5763290f777c 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -558,7 +558,7 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data)
if (status)
goto err_remove_chardev;
- status = gpiochip_sysfs_register(chip);
+ status = gpiochip_sysfs_register(gdev);
if (status)
goto err_remove_device;
@@ -615,7 +615,7 @@ void gpiochip_remove(struct gpio_chip *chip)
gdev->chip = NULL;
/* FIXME: should the legacy sysfs handling be moved to gpio_device? */
- gpiochip_sysfs_unregister(chip);
+ gpiochip_sysfs_unregister(gdev);
gpiochip_irqchip_remove(chip);
acpi_gpiochip_remove(chip);
gpiochip_remove_pin_ranges(chip);