Commit 09669585 authored by Akinobu Mita's avatar Akinobu Mita Committed by Jeff Garzik

[PATCH] n2: fix confusing error code

modprobe n2 with no parameters or no such devices
will get confusing error message.

# modprobe n2
...  Kernel does not have module support

This patch replaces return code from -ENOSYS to -EINVAL.

Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>

 drivers/net/wan/n2.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 9d4df9e0
...@@ -500,7 +500,7 @@ static int __init n2_init(void) ...@@ -500,7 +500,7 @@ static int __init n2_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_INFO "n2: no card initialized\n"); printk(KERN_INFO "n2: no card initialized\n");
#endif #endif
return -ENOSYS; /* no parameters specified, abort */ return -EINVAL; /* no parameters specified, abort */
} }
printk(KERN_INFO "%s\n", version); printk(KERN_INFO "%s\n", version);
...@@ -538,11 +538,11 @@ static int __init n2_init(void) ...@@ -538,11 +538,11 @@ static int __init n2_init(void)
n2_run(io, irq, ram, valid[0], valid[1]); n2_run(io, irq, ram, valid[0], valid[1]);
if (*hw == '\x0') if (*hw == '\x0')
return first_card ? 0 : -ENOSYS; return first_card ? 0 : -EINVAL;
}while(*hw++ == ':'); }while(*hw++ == ':');
printk(KERN_ERR "n2: invalid hardware parameters\n"); printk(KERN_ERR "n2: invalid hardware parameters\n");
return first_card ? 0 : -ENOSYS; return first_card ? 0 : -EINVAL;
} }
......
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