Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290348
b: refs/heads/master
c: 5f2d617
h: refs/heads/master
v: v3
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Feb 6, 2012
1 parent 0343e8b commit 6a4bf76
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 268bd858df5052f97722b123e990119c89171fd7
refs/heads/master: 5f2d6171e1e70584b9819771443485750453fd16
14 changes: 14 additions & 0 deletions trunk/drivers/bcma/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@ static struct bcma_device *bcma_find_core_by_index(struct bcma_bus *bus,
return NULL;
}

static struct bcma_device *bcma_find_core_reverse(struct bcma_bus *bus, u16 coreid)
{
struct bcma_device *core;

list_for_each_entry_reverse(core, &bus->cores, list) {
if (core->id.id == coreid)
return core;
}
return NULL;
}

static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
struct bcma_device_id *match, int core_num,
struct bcma_device *core)
Expand Down Expand Up @@ -392,6 +403,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
bcma_scan_switch_core(bus, erombase);

while (eromptr < eromend) {
struct bcma_device *other_core;
struct bcma_device *core = kzalloc(sizeof(*core), GFP_KERNEL);
if (!core)
return -ENOMEM;
Expand All @@ -411,6 +423,8 @@ int bcma_bus_scan(struct bcma_bus *bus)

core->core_index = core_num++;
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;

pr_info("Core %d found: %s "
"(manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/bcma/bcma.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ struct bcma_device {
bool dev_registered;

u8 core_index;
u8 core_unit;

u32 addr;
u32 wrap;
Expand Down

0 comments on commit 6a4bf76

Please sign in to comment.