1 From 487b997353e2e3afe9c452b20ff5e4320d76e9c3 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Thu, 2 Oct 2014 12:28:54 +0200
4 Subject: [PATCH][RFC] bcma: fill core details for every device
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 We were setting things like dma_dev, IRQ, etc. during core registration
10 only. We need such info for cores handled internally (e.g. ChipCommon)
13 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
15 drivers/bcma/bcma_private.h | 1 +
16 drivers/bcma/main.c | 9 ++++++---
17 drivers/bcma/scan.c | 1 +
18 3 files changed, 8 insertions(+), 3 deletions(-)
20 diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
21 index b6412b2..314ae40 100644
22 --- a/drivers/bcma/bcma_private.h
23 +++ b/drivers/bcma/bcma_private.h
24 @@ -24,6 +24,7 @@ struct bcma_bus;
26 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
28 +void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
29 int bcma_bus_register(struct bcma_bus *bus);
30 void bcma_bus_unregister(struct bcma_bus *bus);
31 int __init bcma_bus_early_register(struct bcma_bus *bus,
32 diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
33 index 5e7a3d4..70d0f23 100644
34 --- a/drivers/bcma/main.c
35 +++ b/drivers/bcma/main.c
36 @@ -172,10 +172,8 @@ static void bcma_of_fill_device(struct platform_device *parent,
38 #endif /* CONFIG_OF */
40 -static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
41 +void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
45 core->dev.release = bcma_release_core_dev;
46 core->dev.bus = &bcma_bus_type;
47 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
48 @@ -199,6 +197,11 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
49 case BCMA_HOSTTYPE_SDIO:
54 +static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
58 err = device_register(&core->dev);
60 diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
61 index 14b5656..9175207 100644
62 --- a/drivers/bcma/scan.c
63 +++ b/drivers/bcma/scan.c
64 @@ -505,6 +505,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
66 other_core = bcma_find_core_reverse(bus, core->id.id);
67 core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
68 + bcma_prepare_core(bus, core);
70 bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
71 core->core_index, bcma_device_name(&core->id),