Skip to content

Commit

Permalink
wlcore: make debug prints work without dynamic debug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arik Nemtsov authored and Luciano Coelho committed Sep 27, 2012
1 parent f4afbed commit fc3d1db
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions drivers/net/wireless/ti/wlcore/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) \
Expand Down

0 comments on commit fc3d1db

Please sign in to comment.