Commit 2e025c71 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by David S. Miller

dm9000: define debug level as a module parameter

This change allows to get driver specific debug messages output
providing a module parameter. As far as the maximum level of verbosity
is too high, it is demoted by default.
Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 823dcd25
...@@ -13,14 +13,6 @@ config DM9000 ...@@ -13,14 +13,6 @@ config DM9000
To compile this driver as a module, choose M here. The module To compile this driver as a module, choose M here. The module
will be called dm9000. will be called dm9000.
config DM9000_DEBUGLEVEL
int "DM9000 maximum debug level"
depends on DM9000
default 4
---help---
The maximum level of debugging code compiled into the DM9000
driver.
config DM9000_FORCE_SIMPLE_PHY_POLL config DM9000_FORCE_SIMPLE_PHY_POLL
bool "Force simple NSR based PHY polling" bool "Force simple NSR based PHY polling"
depends on DM9000 depends on DM9000
......
...@@ -56,6 +56,13 @@ static int watchdog = 5000; ...@@ -56,6 +56,13 @@ static int watchdog = 5000;
module_param(watchdog, int, 0400); module_param(watchdog, int, 0400);
MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds"); MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
/*
* Debug messages level
*/
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "dm9000 debug level (0-4)");
/* DM9000 register address locking. /* DM9000 register address locking.
* *
* The DM9000 uses an address register to control where data written * The DM9000 uses an address register to control where data written
...@@ -103,7 +110,6 @@ typedef struct board_info { ...@@ -103,7 +110,6 @@ typedef struct board_info {
unsigned int flags; unsigned int flags;
unsigned int in_suspend :1; unsigned int in_suspend :1;
unsigned int wake_supported :1; unsigned int wake_supported :1;
int debug_level;
enum dm9000_type type; enum dm9000_type type;
...@@ -138,8 +144,7 @@ typedef struct board_info { ...@@ -138,8 +144,7 @@ typedef struct board_info {
/* debug code */ /* debug code */
#define dm9000_dbg(db, lev, msg...) do { \ #define dm9000_dbg(db, lev, msg...) do { \
if ((lev) < CONFIG_DM9000_DEBUGLEVEL && \ if ((lev) < debug) { \
(lev) < db->debug_level) { \
dev_dbg(db->dev, msg); \ dev_dbg(db->dev, msg); \
} \ } \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment