Skip to content
Snippets Groups Projects
Commit 505be87a authored by Upakul Barkakaty's avatar Upakul Barkakaty Committed by Ben Warren
Browse files

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: default avatarUpakul Barkakaty <upakul.barkakaty@conexant.com>
Signed-off-by: default avatarBen Warren <biggerbadderben@gmail.com>
parent 5ca2d095
No related branches found
No related tags found
No related merge requests found
...@@ -424,23 +424,23 @@ int eth_init(bd_t *bis) ...@@ -424,23 +424,23 @@ int eth_init(bd_t *bis)
struct eth_device* old_current; struct eth_device* old_current;
if (!eth_current) if (!eth_current)
return 0; return -1;
old_current = eth_current; old_current = eth_current;
do { do {
debug ("Trying %s\n", eth_current->name); 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; eth_current->state = ETH_STATE_ACTIVE;
return 1; return 0;
} }
debug ("FAIL\n"); debug ("FAIL\n");
eth_try_another(0); eth_try_another(0);
} while (old_current != eth_current); } while (old_current != eth_current);
return 0; return -1;
} }
void eth_halt(void) void eth_halt(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment