[3.16.y-ckt stable] Patch "gpio: unregister gpiochip device before removing it" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed May 20 12:30:59 UTC 2015


This is a note to let you know that I have just added a patch titled

    gpio: unregister gpiochip device before removing it

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt12.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 52812c8821ed62de51b31c21e38cce42855de723 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan at kernel.org>
Date: Mon, 12 Jan 2015 17:12:29 +0100
Subject: gpio: unregister gpiochip device before removing it

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 at kernel.org>
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
[ luis: backported to 3.16: used Johan's backport to 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 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 d9b8844e2715..3f07d8aa848a 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -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);




More information about the kernel-team mailing list