Skip to contentSkip to conversation

bcma: use custom printing functions

PATCH New Rafał Miłecki 1 participant 1 message Jun 28, 2012 Broadcom specific amba driver (bcma)

lore
Share & tools
lore

Rafał Miłecki

author maintainer
#0 lore raw

PATCH 1/1 bcma: use custom printing functions

Having bus number printed makes it much easier to anaylze logs on systems with more buses. For example Netgear WNDR4500 has 3 AMBA buses in total, which makes standard log really messy.
---
This patch (option B) calls printk directly in custom functions.

Pros: We will still get "bcma" prefix when calling pr_<level> directly!
Cons: Not using prefered pr_<level> in custom functions

Personally I prefer this version. Sometime we can't use custom calls (when we don't have bus reference): in early init or some small functions like SPROM validation. It would be nice to still have "bcma" prefix then (even without bus number).

Normally I don't like calling printk directly, but having such a calls stored in 1 file sounds maintainable.

---
 drivers/bcma/bcma_private.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/bcma/bcma_private.h +5 -0
index b81755b..cc5d7b3 100644
@@ -10,6 +10,11 @@
 
 #define BCMA_CORE_SIZE		0x1000
 
+#define bcma_err(fmt, ...) \
+	printk(KERN_ERR KBUILD_MODNAME "-%d: " fmt, bus->num, ##__VA_ARGS__)
+#define bcma_info(fmt, ...) \
+	printk(KERN_INFO KBUILD_MODNAME "-%d: " fmt, bus->num, ##__VA_ARGS__)
+
 struct bcma_bus;
 
 /* main.c */
Signature · 1 line
1.7.7