diff options
author | Johan Hovold <johan@kernel.org> | 2015-01-12 11:12:29 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-01-14 08:27:01 -0500 |
commit | 01cca93a9491ed95992523ff7e79dd9bfcdea8e0 (patch) | |
tree | cc4ace59913a43506087a87c9655c3bfc91f6962 | |
parent | 6798acaa0138d8b12f1c54402ebcb66fea3deb03 (diff) |
gpio: unregister gpiochip device before removing it
Unregister gpiochip device (used to export information through sysfs)
before removing it internally. This way removal will reverse addition.
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/gpio/gpiolib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 37f919dc2cb4..568aa2b6bdb0 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -327,6 +327,8 @@ void gpiochip_remove(struct gpio_chip *chip) | |||
327 | unsigned long flags; | 327 | unsigned long flags; |
328 | unsigned id; | 328 | unsigned id; |
329 | 329 | ||
330 | gpiochip_unexport(chip); | ||
331 | |||
330 | gpiochip_irqchip_remove(chip); | 332 | gpiochip_irqchip_remove(chip); |
331 | 333 | ||
332 | acpi_gpiochip_remove(chip); | 334 | acpi_gpiochip_remove(chip); |
@@ -343,7 +345,6 @@ void gpiochip_remove(struct gpio_chip *chip) | |||
343 | 345 | ||
344 | list_del(&chip->list); | 346 | list_del(&chip->list); |
345 | spin_unlock_irqrestore(&gpio_lock, flags); | 347 | spin_unlock_irqrestore(&gpio_lock, flags); |
346 | gpiochip_unexport(chip); | ||
347 | 348 | ||
348 | kfree(chip->desc); | 349 | kfree(chip->desc); |
349 | chip->desc = NULL; | 350 | chip->desc = NULL; |