From dbebfbe09774c9c3e5d977c39cb72643dad0c06f Mon Sep 17 00:00:00 2001 From: Satyam Sharma Date: Fri, 10 Aug 2007 15:29:47 -0700 Subject: [PATCH] --- yaml --- r: 66273 b: refs/heads/master c: d2b60881e28072109601c373abd1085499ccfef0 h: refs/heads/master i: 66271: 75ed38a1a5ed358ca62f980d1fa7ea39376f44bd v: v3 --- [refs] | 2 +- trunk/drivers/net/netconsole.c | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 2b9f92ffe403..2ea0117885e5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d133ccbdc30c7f86459519cec1126d6473762b10 +refs/heads/master: d2b60881e28072109601c373abd1085499ccfef0 diff --git a/trunk/drivers/net/netconsole.c b/trunk/drivers/net/netconsole.c index 2c2aef1ae8eb..e56aa6c9743f 100644 --- a/trunk/drivers/net/netconsole.c +++ b/trunk/drivers/net/netconsole.c @@ -53,6 +53,15 @@ static char config[MAX_PARAM_LENGTH]; module_param_string(netconsole, config, MAX_PARAM_LENGTH, 0); MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@/[tgt-macaddr]\n"); +#ifndef MODULE +static int __init option_setup(char *opt) +{ + strlcpy(config, opt, MAX_PARAM_LENGTH); + return 1; +} +__setup("netconsole=", option_setup); +#endif /* MODULE */ + static struct netpoll np = { .name = "netconsole", .dev_name = "eth0", @@ -60,7 +69,6 @@ static struct netpoll np = { .remote_port = 6666, .remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, }; -static int configured; static void write_msg(struct console *con, const char *msg, unsigned int len) { @@ -85,26 +93,19 @@ static struct console netconsole = { .write = write_msg, }; -static int __init option_setup(char *opt) -{ - configured = !netpoll_parse_options(&np, opt); - return 1; -} - -__setup("netconsole=", option_setup); - static int __init init_netconsole(void) { int err = 0; - if (strnlen(config, MAX_PARAM_LENGTH)) - option_setup(config); - - if (!configured) { + if (!strnlen(config, MAX_PARAM_LENGTH)) { printk(KERN_INFO "netconsole: not configured, aborting\n"); goto out; } + err = netpoll_parse_options(&np, config); + if (err) + goto out; + err = netpoll_setup(&np); if (err) goto out;