Skip to content

Commit

Permalink
[PATCH] n2: fix confusing error code
Browse files Browse the repository at this point in the history
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: Akinobu Mita <akinobu.mita@gmail.com>

 drivers/net/wan/n2.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Akinobu Mita authored and Jeff Garzik committed Nov 1, 2006
1 parent 9d4df9e commit 0966958
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wan/n2.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static int __init n2_init(void)
#ifdef MODULE
printk(KERN_INFO "n2: no card initialized\n");
#endif
return -ENOSYS; /* no parameters specified, abort */
return -EINVAL; /* no parameters specified, abort */
}

printk(KERN_INFO "%s\n", version);
Expand Down Expand Up @@ -538,11 +538,11 @@ static int __init n2_init(void)
n2_run(io, irq, ram, valid[0], valid[1]);

if (*hw == '\x0')
return first_card ? 0 : -ENOSYS;
return first_card ? 0 : -EINVAL;
}while(*hw++ == ':');

printk(KERN_ERR "n2: invalid hardware parameters\n");
return first_card ? 0 : -ENOSYS;
return first_card ? 0 : -EINVAL;
}


Expand Down

0 comments on commit 0966958

Please sign in to comment.