[U-Boot-Users] [PATCH] NET: Proper return code handling in eth_init() function in file eth.c
Upakul Barkakaty
upakul at gmail.com
Thu Nov 29 07:46:13 CET 2007
NET: Proper return code handling in eth_init() function in file eth.c
This patch modifies the return code handling in the eth_init()
function, to be compatible with the handling of the return codes in
the other network stack files. It now returns a 0 on Success and -1 on
error.
Signed-off-by: Upakul Barkakaty <upakul.barkakaty at conexant.com>
diff -Naur a/net/eth.c b/net/eth.c
--- a/net/eth.c 2007-11-29 11:54:18.000000000 +0530
+++ b/net/eth.c 2007-11-29 11:54:18.000000000 +0530
@@ -404,23 +404,23 @@
struct eth_device* old_current;
if (!eth_current)
- return 0;
+ return -1;
old_current = eth_current;
do {
debug ("Trying %s\n", eth_current->name);
- if (eth_current->init(eth_current, bis)) {
+ if (!eth_current->init(eth_current,bis)) {
eth_current->state = ETH_STATE_ACTIVE;
- return 1;
+ return 0;
}
debug ("FAIL\n");
eth_try_another(0);
} while (old_current != eth_current);
- return 0;
+ return -1;
}
void eth_halt(void)
More information about the U-Boot
mailing list