diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-02-09 13:21:06 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-02-11 18:16:54 +0100 |
commit | afbc4f312b5e6e87fcd383eb6764e09f1324c78e (patch) | |
tree | 5428e0fe100c576dd158bba68df183010cee2009 /drivers/gpio/gpiolib.c | |
parent | 9efd9e6956adf479eb85beb74bb975f702dc01a9 (diff) |
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.c | 4 |
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); |