aboutsummaryrefslogtreecommitdiff
path: root/drivers/ssb/main.c
diff options
context:
space:
mode:
authorHauke Mehrtens2013-02-03 23:25:34 +0100
committerJohn W. Linville2013-02-04 16:46:24 -0500
commit600485edaef65d89f5c44ce62baa7cac961cd50d (patch)
tree9a651099ddf829c8cd0746f3b00b53744804df41 /drivers/ssb/main.c
parentc50ae9470e542862f782e2d9c106270152bbf3ce (diff)
ssb: unregister gpios before unloading ssb
This patch unregisters the gpio chip before ssb gets unloaded. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/main.c')
-rw-r--r--drivers/ssb/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index c82c5c95fe85..7140c88738f4 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -443,6 +443,15 @@ static void ssb_devices_unregister(struct ssb_bus *bus)
void ssb_bus_unregister(struct ssb_bus *bus)
{
+ int err;
+
+ err = ssb_gpio_unregister(bus);
+ if (err == -EBUSY)
+ ssb_dprintk(KERN_ERR PFX "Some GPIOs are still in use.\n");
+ else if (err)
+ ssb_dprintk(KERN_ERR PFX
+ "Can not unregister GPIO driver: %i\n", err);
+
ssb_buses_lock();
ssb_devices_unregister(bus);
list_del(&bus->list);