Skip to contentSkip to conversation

n2: fix confusing error code

PATCH Applied Akinobu Mita 3 participants 3 messages Oct 28, 2006 – Nov 1, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
Cc Krzysztof Halasa <[email protected]>
 drivers/net/wan/n2.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wan/n2.c +3 -3
Index: work-fault-inject/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;
 }
 
 
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Akinobu Mita

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

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

Now that's interesting :-)

Quoted 5 lines

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

Cc Jeff Garzik <[email protected]>
Cc Krzysztof Halasa <[email protected]>

Jeff, please apply.

Thanks.

Signature · 1 line
Krzysztof Halasa