summaryrefslogtreecommitdiffstats
path: root/net/eth.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-02-27 16:36:22 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-04-06 11:16:13 +0200
commitf9dccf98a3acbe1763d3d75cf455c0b1b0de51a5 (patch)
treecd35ea835b1d7c99f8e5bae5964c14a913325ad3 /net/eth.c
parentb7ed4d8fa925c5c686b771027ec35efb1d9e4be1 (diff)
downloadbarebox-f9dccf98a3acbe1763d3d75cf455c0b1b0de51a5.tar.gz
barebox-f9dccf98a3acbe1763d3d75cf455c0b1b0de51a5.tar.xz
eth.c: Fix return values
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/eth.c')
-rw-r--r--net/eth.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/eth.c b/net/eth.c
index c7d1021416..e74ab3b5cf 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -45,11 +45,9 @@ struct eth_device * eth_get_current(void)
int eth_open(void)
{
if (!eth_current)
- return 0;
+ return -ENODEV;
- eth_current->open(eth_current);
-
- return 0;
+ return eth_current->open(eth_current);
}
void eth_halt(void)
@@ -65,7 +63,7 @@ void eth_halt(void)
int eth_send(void *packet, int length)
{
if (!eth_current)
- return -1;
+ return -ENODEV;
return eth_current->send(eth_current, packet, length);
}
@@ -73,7 +71,7 @@ int eth_send(void *packet, int length)
int eth_rx(void)
{
if (!eth_current)
- return -1;
+ return -ENODEV;
return eth_current->recv(eth_current);
}