]> git.sur5r.net Git - u-boot/commitdiff
NET: Proper return code handling in eth_init() function in file eth.c
authorUpakul Barkakaty <upakul@gmail.com>
Thu, 29 Nov 2007 06:46:13 +0000 (12:16 +0530)
committerBen Warren <biggerbadderben@gmail.com>
Fri, 4 Jan 2008 03:39:51 +0000 (22:39 -0500)
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@conexant.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
net/eth.c

index 425f29edba4a7c73b421fd70fec1fc70813edf2b..3373a05252197665c54b493570a5231263b35c1d 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -424,23 +424,23 @@ int eth_init(bd_t *bis)
        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)