diff mbox

[U-Boot,v3] net: usb: mcs7830: fix no DM recive path

Message ID 1495104651-18871-1-git-send-email-uri.mashiach@compulab.co.il
State Superseded
Delegated to: Marek Vasut
Headers show

Commit Message

Uri Mashiach May 18, 2017, 10:50 a.m. UTC
The function mcs7830_recv_common() returns a negative value on error, 0
or positive value on success.
Fix the condition for calling the function
net_process_received_packet().

The function mcs7830_recv() is always returning 0.
Update the return value of mcs7830_recv() to reflect the function's
success status.

Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
---
v1 -> v3: update the commit message.

 drivers/usb/eth/mcs7830.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/usb/eth/mcs7830.c b/drivers/usb/eth/mcs7830.c
index 9d6cf8c..4abef5d 100644
--- a/drivers/usb/eth/mcs7830.c
+++ b/drivers/usb/eth/mcs7830.c
@@ -622,10 +622,12 @@  static int mcs7830_recv(struct eth_device *eth)
 	int len;
 
 	len = mcs7830_recv_common(ueth, buf);
-	if (len <= 0)
+	if (len >= 0) {
 		net_process_received_packet(buf, len);
+		return 0;
+	}
 
-	return 0;
+	return len;
 }
 
 /*