aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bcma/main.c')
-rw-r--r--drivers/bcma/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 432aeeedfd5e..d865470bc951 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -158,9 +158,10 @@ static int bcma_register_cores(struct bcma_bus *bus)
158 158
159static void bcma_unregister_cores(struct bcma_bus *bus) 159static void bcma_unregister_cores(struct bcma_bus *bus)
160{ 160{
161 struct bcma_device *core; 161 struct bcma_device *core, *tmp;
162 162
163 list_for_each_entry(core, &bus->cores, list) { 163 list_for_each_entry_safe(core, tmp, &bus->cores, list) {
164 list_del(&core->list);
164 if (core->dev_registered) 165 if (core->dev_registered)
165 device_unregister(&core->dev); 166 device_unregister(&core->dev);
166 } 167 }