diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-08-02 16:27:51 +0400 |
---|---|---|
committer | Luciano Coelho <luca@coelho.fi> | 2012-09-27 13:13:52 +0400 |
commit | fc3d1db5b60ebb81f9ce2ac3a1192f2c763ab504 (patch) | |
tree | 04e5940b102ec7394d742e6253665c7eb635a9a5 /drivers/net/wireless/ti | |
parent | f4afbed9447c86e5d3cec5933ae74b902617987c (diff) | |
download | linux-fc3d1db5b60ebb81f9ce2ac3a1192f2c763ab504.tar.xz |
wlcore: make debug prints work without dynamic debug
Make debug prints operational when dynamic debug is not defined.
This allows better debugging in production environments.
Change the driver prefix to "wlcore" while were at it.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/debug.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wlcore/debug.h b/drivers/net/wireless/ti/wlcore/debug.h index 6b800b3cbea5..db4bf5a68ce2 100644 --- a/drivers/net/wireless/ti/wlcore/debug.h +++ b/drivers/net/wireless/ti/wlcore/debug.h @@ -28,7 +28,7 @@ #include <linux/bitops.h> #include <linux/printk.h> -#define DRIVER_NAME "wl12xx" +#define DRIVER_NAME "wlcore" #define DRIVER_PREFIX DRIVER_NAME ": " enum { @@ -73,11 +73,21 @@ extern u32 wl12xx_debug_level; #define wl1271_info(fmt, arg...) \ pr_info(DRIVER_PREFIX fmt "\n", ##arg) +/* define the debug macro differently if dynamic debug is supported */ +#if defined(CONFIG_DYNAMIC_DEBUG) #define wl1271_debug(level, fmt, arg...) \ do { \ - if (level & wl12xx_debug_level) \ - pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \ + if (unlikely(level & wl12xx_debug_level)) \ + dynamic_pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \ + } while (0) +#else +#define wl1271_debug(level, fmt, arg...) \ + do { \ + if (unlikely(level & wl12xx_debug_level)) \ + printk(KERN_DEBUG pr_fmt(DRIVER_PREFIX fmt "\n"), \ + ##arg); \ } while (0) +#endif /* TODO: use pr_debug_hex_dump when it becomes available */ #define wl1271_dump(level, prefix, buf, len) \ |