Skip to content

Commit 2e025c7

Browse files
vzapolskiydavem330
authored andcommitted
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: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 823dcd2 commit 2e025c7

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

‎drivers/net/ethernet/davicom/Kconfig‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ config DM9000
1313
To compile this driver as a module, choose M here. The module
1414
will be called dm9000.
1515

16-
config DM9000_DEBUGLEVEL
17-
int "DM9000 maximum debug level"
18-
depends on DM9000
19-
default 4
20-
---help---
21-
The maximum level of debugging code compiled into the DM9000
22-
driver.
23-
2416
config DM9000_FORCE_SIMPLE_PHY_POLL
2517
bool "Force simple NSR based PHY polling"
2618
depends on DM9000

‎drivers/net/ethernet/davicom/dm9000.c‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ static int watchdog = 5000;
5656
module_param(watchdog, int, 0400);
5757
MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
5858

59+
/*
60+
* Debug messages level
61+
*/
62+
static int debug;
63+
module_param(debug, int, 0644);
64+
MODULE_PARM_DESC(debug, "dm9000 debug level (0-4)");
65+
5966
/* DM9000 register address locking.
6067
*
6168
* The DM9000 uses an address register to control where data written
@@ -103,7 +110,6 @@ typedef struct board_info {
103110
unsigned int flags;
104111
unsigned int in_suspend :1;
105112
unsigned int wake_supported :1;
106-
int debug_level;
107113

108114
enum dm9000_type type;
109115

@@ -138,8 +144,7 @@ typedef struct board_info {
138144
/* debug code */
139145

140146
#define dm9000_dbg(db, lev, msg...) do { \
141-
if ((lev) < CONFIG_DM9000_DEBUGLEVEL && \
142-
(lev) < db->debug_level) { \
147+
if ((lev) < debug) { \
143148
dev_dbg(db->dev, msg); \
144149
} \
145150
} while (0)

0 commit comments

Comments
 (0)