Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349664
b: refs/heads/master
c: c50ae94
h: refs/heads/master
v: v3
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Feb 4, 2013
1 parent 23c84be commit 892d2ad
Show file tree
Hide file tree
Showing 4 changed files with 18 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: a5ffbe0a1993a27072742ef7db6cf9839956fce9
refs/heads/master: c50ae9470e542862f782e2d9c106270152bbf3ce
5 changes: 5 additions & 0 deletions trunk/drivers/bcma/bcma_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
#ifdef CONFIG_BCMA_DRIVER_GPIO
/* driver_gpio.c */
int bcma_gpio_init(struct bcma_drv_cc *cc);
int bcma_gpio_unregister(struct bcma_drv_cc *cc);
#else
static inline int bcma_gpio_init(struct bcma_drv_cc *cc)
{
return -ENOTSUPP;
}
static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc)
{
return 0;
}
#endif /* CONFIG_BCMA_DRIVER_GPIO */

#endif
5 changes: 5 additions & 0 deletions trunk/drivers/bcma/driver_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,8 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)

return gpiochip_add(chip);
}

int bcma_gpio_unregister(struct bcma_drv_cc *cc)
{
return gpiochip_remove(&cc->gpio);
}
7 changes: 7 additions & 0 deletions trunk/drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
void bcma_bus_unregister(struct bcma_bus *bus)
{
struct bcma_device *cores[3];
int err;

err = bcma_gpio_unregister(&bus->drv_cc);
if (err == -EBUSY)
bcma_err(bus, "Some GPIOs are still in use.\n");
else if (err)
bcma_err(bus, "Can not unregister GPIO driver: %i\n", err);

cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K);
cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE);
Expand Down

0 comments on commit 892d2ad

Please sign in to comment.