From: Akinobu Mita <akinobu.mita@gmail.com>
Date: Sat, 28 Oct 2006 18:47:12 +0000 (+0900)
Subject: [PATCH] n2: fix confusing error code
X-Git-Tag: firefly_0821_release~31522^2~20^2~261
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=09669585b5d0cfdebe28250d442693b3baac66a2;p=firefly-linux-kernel-4.4.55.git

[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: 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>
---

diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index dcf46add3adf..5c322dfb79f6 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -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);
@@ -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;
 }