aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-10-03 11:00:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-10-27 14:16:13 -0400
commitab54bc8460b5730ce4d2b50f5b928b230ec994d9 (patch)
treebb8f4fb0e8544504ab2a68a137963c316d6a347a /drivers/bcma
parent490f0dc4d52a01904cead9dd2fa57956ca737eb7 (diff)
bcma: fill core details for every device
We were setting things like dma_dev, IRQ, etc. during core registration only. We need such info for cores handled internally (e.g. ChipCommon) as well. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/bcma_private.h1
-rw-r--r--drivers/bcma/main.c9
-rw-r--r--drivers/bcma/scan.c1
3 files changed, 8 insertions, 3 deletions
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index b6412b2d748d..314ae4032f3e 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -24,6 +24,7 @@ struct bcma_bus;
24/* main.c */ 24/* main.c */
25bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, 25bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
26 int timeout); 26 int timeout);
27void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
27int bcma_bus_register(struct bcma_bus *bus); 28int bcma_bus_register(struct bcma_bus *bus);
28void bcma_bus_unregister(struct bcma_bus *bus); 29void bcma_bus_unregister(struct bcma_bus *bus);
29int __init bcma_bus_early_register(struct bcma_bus *bus, 30int __init bcma_bus_early_register(struct bcma_bus *bus,
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index d1656c2f70af..9b229c9c35e5 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -169,10 +169,8 @@ static void bcma_of_fill_device(struct platform_device *parent,
169} 169}
170#endif /* CONFIG_OF */ 170#endif /* CONFIG_OF */
171 171
172static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) 172void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
173{ 173{
174 int err;
175
176 core->dev.release = bcma_release_core_dev; 174 core->dev.release = bcma_release_core_dev;
177 core->dev.bus = &bcma_bus_type; 175 core->dev.bus = &bcma_bus_type;
178 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); 176 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
@@ -196,6 +194,11 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
196 case BCMA_HOSTTYPE_SDIO: 194 case BCMA_HOSTTYPE_SDIO:
197 break; 195 break;
198 } 196 }
197}
198
199static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
200{
201 int err;
199 202
200 err = device_register(&core->dev); 203 err = device_register(&core->dev);
201 if (err) { 204 if (err) {
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 14b56561a36f..917520776879 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -505,6 +505,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
505 bus->nr_cores++; 505 bus->nr_cores++;
506 other_core = bcma_find_core_reverse(bus, core->id.id); 506 other_core = bcma_find_core_reverse(bus, core->id.id);
507 core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1; 507 core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
508 bcma_prepare_core(bus, core);
508 509
509 bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n", 510 bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
510 core->core_index, bcma_device_name(&core->id), 511 core->core_index, bcma_device_name(&core->id),