aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c3
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;