diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-02-18 16:03:14 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-02-22 16:36:00 -0500 |
commit | 26b4950de174bc96c27b77546370dec84fb75ae7 (patch) | |
tree | a48479a6f1f4675d900b621d6ddfde92aadb0e33 /drivers/firewire/core-card.c | |
parent | 8408dc1c14c113face77f6f967af98f76999989f (diff) |
firewire: core: prefix log messages with card name
Associate all log messages from firewire-core with the respective card
because some people have more than one card. E.g.
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core: created device fw0: GUID 0814438400000389, S800
firewire_core: phy config: new root=ffc1, gap_count=5
firewire_core: created device fw1: GUID 0814438400000388, S800
firewire_core: created device fw2: GUID 0001d202e06800d1, S800
turns into
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core 0000:04:00.0: created device fw0: GUID 0814438400000389, S800
firewire_core 0000:04:00.0: phy config: new root=ffc1, gap_count=5
firewire_core 0000:05:00.0: created device fw1: GUID 0814438400000388, S800
firewire_core 0000:04:00.0: created device fw2: GUID 0001d202e06800d1, S800
This increases the module size slightly; to keep this in check, turn the
former printk wrapper macros into functions. Their implementation is
largely copied from driver core's dev_printk counterparts.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r-- | drivers/firewire/core-card.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 85661b060ed7..b19db0f6a254 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c | |||
@@ -37,6 +37,22 @@ | |||
37 | 37 | ||
38 | #include "core.h" | 38 | #include "core.h" |
39 | 39 | ||
40 | #define define_fw_printk_level(func, kern_level) \ | ||
41 | void func(const struct fw_card *card, const char *fmt, ...) \ | ||
42 | { \ | ||
43 | struct va_format vaf; \ | ||
44 | va_list args; \ | ||
45 | \ | ||
46 | va_start(args, fmt); \ | ||
47 | vaf.fmt = fmt; \ | ||
48 | vaf.va = &args; \ | ||
49 | printk(kern_level KBUILD_MODNAME " %s: %pV", \ | ||
50 | dev_name(card->device), &vaf); \ | ||
51 | va_end(args); \ | ||
52 | } | ||
53 | define_fw_printk_level(fw_err, KERN_ERR); | ||
54 | define_fw_printk_level(fw_notice, KERN_NOTICE); | ||
55 | |||
40 | int fw_compute_block_crc(__be32 *block) | 56 | int fw_compute_block_crc(__be32 *block) |
41 | { | 57 | { |
42 | int length; | 58 | int length; |
@@ -260,7 +276,7 @@ static void allocate_broadcast_channel(struct fw_card *card, int generation) | |||
260 | fw_iso_resource_manage(card, generation, 1ULL << 31, | 276 | fw_iso_resource_manage(card, generation, 1ULL << 31, |
261 | &channel, &bandwidth, true); | 277 | &channel, &bandwidth, true); |
262 | if (channel != 31) { | 278 | if (channel != 31) { |
263 | fw_notify("failed to allocate broadcast channel\n"); | 279 | fw_notice(card, "failed to allocate broadcast channel\n"); |
264 | return; | 280 | return; |
265 | } | 281 | } |
266 | card->broadcast_channel_allocated = true; | 282 | card->broadcast_channel_allocated = true; |
@@ -343,14 +359,14 @@ static void bm_work(struct work_struct *work) | |||
343 | 359 | ||
344 | if (!card->irm_node->link_on) { | 360 | if (!card->irm_node->link_on) { |
345 | new_root_id = local_id; | 361 | new_root_id = local_id; |
346 | fw_notify("%s, making local node (%02x) root.\n", | 362 | fw_notice(card, "%s, making local node (%02x) root\n", |
347 | "IRM has link off", new_root_id); | 363 | "IRM has link off", new_root_id); |
348 | goto pick_me; | 364 | goto pick_me; |
349 | } | 365 | } |
350 | 366 | ||
351 | if (irm_is_1394_1995_only && !keep_this_irm) { | 367 | if (irm_is_1394_1995_only && !keep_this_irm) { |
352 | new_root_id = local_id; | 368 | new_root_id = local_id; |
353 | fw_notify("%s, making local node (%02x) root.\n", | 369 | fw_notice(card, "%s, making local node (%02x) root\n", |
354 | "IRM is not 1394a compliant", new_root_id); | 370 | "IRM is not 1394a compliant", new_root_id); |
355 | goto pick_me; | 371 | goto pick_me; |
356 | } | 372 | } |
@@ -405,7 +421,7 @@ static void bm_work(struct work_struct *work) | |||
405 | * root, and thus, IRM. | 421 | * root, and thus, IRM. |
406 | */ | 422 | */ |
407 | new_root_id = local_id; | 423 | new_root_id = local_id; |
408 | fw_notify("%s, making local node (%02x) root.\n", | 424 | fw_notice(card, "%s, making local node (%02x) root\n", |
409 | "BM lock failed", new_root_id); | 425 | "BM lock failed", new_root_id); |
410 | goto pick_me; | 426 | goto pick_me; |
411 | } | 427 | } |
@@ -478,8 +494,8 @@ static void bm_work(struct work_struct *work) | |||
478 | spin_unlock_irq(&card->lock); | 494 | spin_unlock_irq(&card->lock); |
479 | 495 | ||
480 | if (do_reset) { | 496 | if (do_reset) { |
481 | fw_notify("phy config: card %d, new root=%x, gap_count=%d\n", | 497 | fw_notice(card, "phy config: new root=%x, gap_count=%d\n", |
482 | card->index, new_root_id, gap_count); | 498 | new_root_id, gap_count); |
483 | fw_send_phy_config(card, new_root_id, generation, gap_count); | 499 | fw_send_phy_config(card, new_root_id, generation, gap_count); |
484 | reset_bus(card, true); | 500 | reset_bus(card, true); |
485 | /* Will allocate broadcast channel after the reset. */ | 501 | /* Will allocate broadcast channel after the reset. */ |