Commit 52812c88 authored by Johan Hovold's avatar Johan Hovold Committed by Luis Henriques

gpio: unregister gpiochip device before removing it

commit 01cca93a upstream.

Unregister gpiochip device (used to export information through sysfs)
before removing it internally. This way removal will reverse addition.
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
[ luis: backported to 3.16: used Johan's backport to 3.14 ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 5b79da61
......@@ -1287,6 +1287,8 @@ int gpiochip_remove(struct gpio_chip *chip)
int status = 0;
unsigned id;
gpiochip_unexport(chip);
gpiochip_irqchip_remove(chip);
acpi_gpiochip_remove(chip);
......@@ -1309,9 +1311,6 @@ int gpiochip_remove(struct gpio_chip *chip)
spin_unlock_irqrestore(&gpio_lock, flags);
if (status == 0)
gpiochip_unexport(chip);
return status;
}
EXPORT_SYMBOL_GPL(gpiochip_remove);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment