Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349665
b: refs/heads/master
c: 600485e
h: refs/heads/master
i:
  349663: 23c84be
v: v3
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Feb 4, 2013
1 parent 892d2ad commit 8b730b7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c50ae9470e542862f782e2d9c106270152bbf3ce
refs/heads/master: 600485edaef65d89f5c44ce62baa7cac961cd50d
12 changes: 12 additions & 0 deletions trunk/drivers/ssb/driver_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,15 @@ int ssb_gpio_init(struct ssb_bus *bus)

return -1;
}

int ssb_gpio_unregister(struct ssb_bus *bus)
{
if (ssb_chipco_available(&bus->chipco) ||
ssb_extif_available(&bus->extif)) {
return gpiochip_remove(&bus->gpio);
} else {
SSB_WARN_ON(1);
}

return -1;
}
9 changes: 9 additions & 0 deletions trunk/drivers/ssb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/ssb/ssb_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,16 @@ static inline void ssb_extif_init(struct ssb_extif *extif)

#ifdef CONFIG_SSB_DRIVER_GPIO
extern int ssb_gpio_init(struct ssb_bus *bus);
extern int ssb_gpio_unregister(struct ssb_bus *bus);
#else /* CONFIG_SSB_DRIVER_GPIO */
static inline int ssb_gpio_init(struct ssb_bus *bus)
{
return -ENOTSUPP;
}
static inline int ssb_gpio_unregister(struct ssb_bus *bus)
{
return 0;
}
#endif /* CONFIG_SSB_DRIVER_GPIO */

#endif /* LINUX_SSB_PRIVATE_H_ */

0 comments on commit 8b730b7

Please sign in to comment.