提交 01cca93a 编写于 作者: J Johan Hovold 提交者: Linus Walleij

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: NJohan Hovold <johan@kernel.org>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 6798acaa
......@@ -327,6 +327,8 @@ void gpiochip_remove(struct gpio_chip *chip)
unsigned long flags;
unsigned id;
gpiochip_unexport(chip);
gpiochip_irqchip_remove(chip);
acpi_gpiochip_remove(chip);
......@@ -343,7 +345,6 @@ void gpiochip_remove(struct gpio_chip *chip)
list_del(&chip->list);
spin_unlock_irqrestore(&gpio_lock, flags);
gpiochip_unexport(chip);
kfree(chip->desc);
chip->desc = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册