diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-09-17 17:50:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-26 17:06:50 -0400 |
commit | fbf019909173c683d85f7f63b0a33746bf5e4a02 (patch) | |
tree | c0e9bfde5923fe38ec1cc0ff30697218443eedfb /drivers/bcma/scan.c | |
parent | 8eda10eaa18709e951b5d5fbbf673543365a4455 (diff) |
bcma: print chip ID in a more user-friendly form
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>
Diffstat (limited to 'drivers/bcma/scan.c')
-rw-r--r-- | drivers/bcma/scan.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index b3a403c136fb..14b56561a36f 100644 --- a/drivers/bcma/scan.c +++ b/drivers/bcma/scan.c | |||
@@ -439,6 +439,7 @@ void bcma_init_bus(struct bcma_bus *bus) | |||
439 | { | 439 | { |
440 | s32 tmp; | 440 | s32 tmp; |
441 | struct bcma_chipinfo *chipinfo = &(bus->chipinfo); | 441 | struct bcma_chipinfo *chipinfo = &(bus->chipinfo); |
442 | char chip_id[8]; | ||
442 | 443 | ||
443 | INIT_LIST_HEAD(&bus->cores); | 444 | INIT_LIST_HEAD(&bus->cores); |
444 | bus->nr_cores = 0; | 445 | bus->nr_cores = 0; |
@@ -449,8 +450,11 @@ void bcma_init_bus(struct bcma_bus *bus) | |||
449 | chipinfo->id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT; | 450 | chipinfo->id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT; |
450 | chipinfo->rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT; | 451 | chipinfo->rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT; |
451 | chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT; | 452 | chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT; |
452 | bcma_info(bus, "Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n", | 453 | |
453 | chipinfo->id, chipinfo->rev, chipinfo->pkg); | 454 | snprintf(chip_id, ARRAY_SIZE(chip_id), |
455 | (chipinfo->id > 0x9999) ? "%d" : "0x%04X", chipinfo->id); | ||
456 | bcma_info(bus, "Found chip with id %s, rev 0x%02X and package 0x%02X\n", | ||
457 | chip_id, chipinfo->rev, chipinfo->pkg); | ||
454 | } | 458 | } |
455 | 459 | ||
456 | int bcma_bus_scan(struct bcma_bus *bus) | 460 | int bcma_bus_scan(struct bcma_bus *bus) |