summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-03-22 17:09:04 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:11 -0600
commit05324a488b09c57e7bcc70ae528cd7c098c3e3d3 (patch)
tree19db2fc3fb8e066f95a48bc2aca03400290d4a9a /net
parent84eb1fba7b50aea7807c85258ced2c2be7dca18f (diff)
downloadu-boot-imx-05324a488b09c57e7bcc70ae528cd7c098c3e3d3.zip
u-boot-imx-05324a488b09c57e7bcc70ae528cd7c098c3e3d3.tar.gz
u-boot-imx-05324a488b09c57e7bcc70ae528cd7c098c3e3d3.tar.bz2
net: Change return codes from net/eth.c to use errorno constants
Many functions returned -1 previously. Change them to return appropriate error codes. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/eth.c b/net/eth.c
index 84919e0..9ad15cd 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -227,7 +227,7 @@ int eth_unregister(struct eth_device *dev)
/* No device */
if (!eth_devices)
- return -1;
+ return -ENODEV;
for (cur = eth_devices; cur->next != eth_devices && cur->next != dev;
cur = cur->next)
@@ -235,7 +235,7 @@ int eth_unregister(struct eth_device *dev)
/* Device not found */
if (cur->next != dev)
- return -1;
+ return -ENODEV;
cur->next = dev->next;
@@ -368,7 +368,7 @@ int eth_init(bd_t *bis)
if (!eth_current) {
puts("No ethernet found.\n");
- return -1;
+ return -ENODEV;
}
/* Sync environment with network devices */
@@ -397,7 +397,7 @@ int eth_init(bd_t *bis)
eth_try_another(0);
} while (old_current != eth_current);
- return -1;
+ return -ETIMEDOUT;
}
void eth_halt(void)
@@ -413,7 +413,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);
}
@@ -421,7 +421,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);
}