Skip to content

Commit

Permalink
bcma: print chip ID in a more user-friendly form
Browse files Browse the repository at this point in the history
Some chip IDs are easier to read/understand when printed in a decimal
form. For example on my bcm53xx arch router this patch replaces:
Found chip with id 0xCF12, rev 0x00 and package 0x02
with a:
Found chip with id 53010, rev 0x00 and package 0x02

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
rmilecki authored and linvjw committed Sep 26, 2014
1 parent 8eda10e commit fbf0199
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/bcma/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ void bcma_init_bus(struct bcma_bus *bus)
{
s32 tmp;
struct bcma_chipinfo *chipinfo = &(bus->chipinfo);
char chip_id[8];

INIT_LIST_HEAD(&bus->cores);
bus->nr_cores = 0;
Expand All @@ -449,8 +450,11 @@ void bcma_init_bus(struct bcma_bus *bus)
chipinfo->id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT;
chipinfo->rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT;
chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
bcma_info(bus, "Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n",
chipinfo->id, chipinfo->rev, chipinfo->pkg);

snprintf(chip_id, ARRAY_SIZE(chip_id),
(chipinfo->id > 0x9999) ? "%d" : "0x%04X", chipinfo->id);
bcma_info(bus, "Found chip with id %s, rev 0x%02X and package 0x%02X\n",
chip_id, chipinfo->rev, chipinfo->pkg);
}

int bcma_bus_scan(struct bcma_bus *bus)
Expand Down

0 comments on commit fbf0199

Please sign in to comment.