X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fbcma%2Fmain.c;h=94dd240beef3b1a66eee67fd8ef191f6112908a8;hb=399ae5ba263e672bf105414f8e71adc9ff223134;hp=8c09c3e547cd1d305050d9885a6641c9b33dcd01;hpb=addd8c92cf55bba578b8a56e0f717a0a74b31008;p=pandora-kernel.git diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 8c09c3e547cd..94dd240beef3 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -6,6 +6,7 @@ */ #include "bcma_private.h" +#include #include #include @@ -123,9 +124,10 @@ static int bcma_register_cores(struct bcma_bus *bus) static void bcma_unregister_cores(struct bcma_bus *bus) { - struct bcma_device *core; + struct bcma_device *core, *tmp; - list_for_each_entry(core, &bus->cores, list) { + list_for_each_entry_safe(core, tmp, &bus->cores, list) { + list_del(&core->list); if (core->dev_registered) device_unregister(&core->dev); } @@ -239,6 +241,22 @@ int __init bcma_bus_early_register(struct bcma_bus *bus, return 0; } +#ifdef CONFIG_PM +int bcma_bus_resume(struct bcma_bus *bus) +{ + struct bcma_device *core; + + /* Init CC core */ + core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON); + if (core) { + bus->drv_cc.setup_done = false; + bcma_core_chipcommon_init(&bus->drv_cc); + } + + return 0; +} +#endif + int __bcma_driver_register(struct bcma_driver *drv, struct module *owner) { drv->drv.name = drv->name; @@ -279,8 +297,11 @@ static int bcma_device_probe(struct device *dev) drv); int err = 0; + get_device(dev); if (adrv->probe) err = adrv->probe(core); + if (err) + put_device(dev); return err; } @@ -293,6 +314,7 @@ static int bcma_device_remove(struct device *dev) if (adrv->remove) adrv->remove(core); + put_device(dev); return 0; }