summaryrefslogtreecommitdiffstats
path: root/drivers/net/smc91111.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-02-24 10:32:13 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-26 11:05:02 +0100
commitdc62dd48d80163b05e52cdb5183a9a387a094e0b (patch)
treee62f5d7a3d4465b2467b8512f576cdb5321a4421 /drivers/net/smc91111.c
parent6ad2bdb8e19f6ccc53b715351435e62b800021b9 (diff)
downloadbarebox-dc62dd48d80163b05e52cdb5183a9a387a094e0b.tar.gz
barebox-dc62dd48d80163b05e52cdb5183a9a387a094e0b.tar.xz
smc911111: fix send and recv return value
on error send error code and 0 on success Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/smc91111.c')
-rw-r--r--drivers/net/smc91111.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index 695fa7d7b1..48183dd4fa 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -935,7 +935,7 @@ static int smc91c111_eth_send(struct eth_device *edev, void *packet,
if (numPages > 7) {
printf ("%s: Far too big packet error. \n", SMC_DEV_NAME);
- return 0;
+ return -EOVERFLOW;
}
/* now, try to allocate the memory */
@@ -965,7 +965,7 @@ again:
if (try < SMC_ALLOC_MAX_TRY)
goto again;
else
- return 0;
+ return -ETIMEDOUT;
}
PRINTK2 ("%s: memory allocation, try %d succeeded ...\n",
@@ -980,7 +980,7 @@ again:
if (packet_no & AR_FAILED) {
/* or isn't there? BAD CHIP! */
printf ("%s: Memory allocation failed. \n", SMC_DEV_NAME);
- return 0;
+ return -ENOMEM;
}
/* we have a packet address, so tell the card to use it */
@@ -1046,7 +1046,7 @@ again:
SMC_outb(priv, saved_pnr, PN_REG );
SMC_outw(priv, saved_ptr, PTR_REG );
- return length;
+ return 0;
}
static void smc91c111_eth_halt(struct eth_device *edev)
@@ -1152,10 +1152,10 @@ static int smc91c111_eth_rx(struct eth_device *edev)
if (!is_error) {
/* Pass the packet up to the protocol layers. */
net_receive(NetRxPackets[0], packet_length);
- return packet_length;
+ return 0;
}
- return 0;
+ return -EINVAL;
}
static int smc91c111_get_ethaddr(struct eth_device *edev, unsigned char *m)