mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 05:24:12 +08:00
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>
This commit is contained in:
parent
6798acaa01
commit
01cca93a94
@ -327,6 +327,8 @@ void gpiochip_remove(struct gpio_chip *chip)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned id;
|
unsigned id;
|
||||||
|
|
||||||
|
gpiochip_unexport(chip);
|
||||||
|
|
||||||
gpiochip_irqchip_remove(chip);
|
gpiochip_irqchip_remove(chip);
|
||||||
|
|
||||||
acpi_gpiochip_remove(chip);
|
acpi_gpiochip_remove(chip);
|
||||||
@ -343,7 +345,6 @@ void gpiochip_remove(struct gpio_chip *chip)
|
|||||||
|
|
||||||
list_del(&chip->list);
|
list_del(&chip->list);
|
||||||
spin_unlock_irqrestore(&gpio_lock, flags);
|
spin_unlock_irqrestore(&gpio_lock, flags);
|
||||||
gpiochip_unexport(chip);
|
|
||||||
|
|
||||||
kfree(chip->desc);
|
kfree(chip->desc);
|
||||||
chip->desc = NULL;
|
chip->desc = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user