path: root/drivers/net
diff options
authorOleksandr Tymoshenko <>2016-07-01 13:22:00 -0700
committerJoe Hershberger <>2016-07-06 10:45:11 -0500
commit4c64c4db3b87818318ed8b4cd6907c508aaf04ce (patch)
tree7269bd2af9ebd622030a5c22d5d91b41b7daf789 /drivers/net
parente4ead4a21db266c84051279ed4ceeab72981df8c (diff)
net: rtl8169: Fix return value for rtl_send_common
Return value of rtl_send_common propogates unmodified all the way up to eth_send and further to API consumer if CONFIG_API is enabled. Previously rtl_send_common returned number of bytes sent on success which was erroneouly detected as error condition by API consumers that checked for operation success by comparing return value with 0. Switch rtl_send_common to use common convention: return 0 on success and negative value for failure. Cc: Stephen Warren <> Cc: Joe Hershberger <> Signed-off-by: Oleksandr Tymoshenko <> Reviewed-by: Simon Glass <> Acked-by: Joe Hershberger <>
Diffstat (limited to 'drivers/net')
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index 843b083f8f..1cc0b40935 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -666,12 +666,12 @@ static int rtl_send_common(pci_dev_t dev, unsigned long dev_iobase,
puts("tx timeout/error\n");
printf("%s elapsed time : %lu\n", __func__, currticks()-stime);
- ret = 0;
+ ret = -ETIMEDOUT;
} else {
#ifdef DEBUG_RTL8169_TX
puts("tx done\n");
- ret = length;
+ ret = 0;
/* Delay to make net console (nc) work properly */
OpenPOWER on IntegriCloud