lkml.org 
[lkml]   [2015]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3.12 115/142] gpio: unregister gpiochip device before removing it
Date
From: Johan Hovold <johan@kernel.org>

3.12-stable review patch. If anyone has any objections, please let me know.

===============

commit 01cca93a9491ed95992523ff7e79dd9bfcdea8e0 upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/gpio/gpiolib.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 8a9b61adcd87..9ba1bb0edab3 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1257,6 +1257,8 @@ int gpiochip_remove(struct gpio_chip *chip)
int status = 0;
unsigned id;

+ gpiochip_unexport(chip);
+
spin_lock_irqsave(&gpio_lock, flags);

gpiochip_remove_pin_ranges(chip);
@@ -1277,9 +1279,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);
--
2.3.7


\
 
 \ /
  Last update: 2015-05-16 10:41    [W:0.454 / U:1.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site