Skip to content

Commit

Permalink
bcma: fill core details for every device
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Hauke Mehrtens <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
rmilecki authored and linvjw committed Oct 27, 2014
1 parent 490f0dc commit ab54bc8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions drivers/bcma/bcma_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct bcma_bus;
/* main.c */
bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
int timeout);
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
int bcma_bus_register(struct bcma_bus *bus);
void bcma_bus_unregister(struct bcma_bus *bus);
int __init bcma_bus_early_register(struct bcma_bus *bus,
Expand Down
9 changes: 6 additions & 3 deletions drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,8 @@ static void bcma_of_fill_device(struct platform_device *parent,
}
#endif /* CONFIG_OF */

static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
{
int err;

core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
Expand All @@ -196,6 +194,11 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
case BCMA_HOSTTYPE_SDIO:
break;
}
}

static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
{
int err;

err = device_register(&core->dev);
if (err) {
Expand Down
1 change: 1 addition & 0 deletions drivers/bcma/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
bus->nr_cores++;
other_core = bcma_find_core_reverse(bus, core->id.id);
core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
bcma_prepare_core(bus, core);

bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
core->core_index, bcma_device_name(&core->id),
Expand Down

0 comments on commit ab54bc8

Please sign in to comment.