[4/4] Revert "UBUNTU: SAUCE: Revert "lan78xx: Correctly indicate invalid OTP""

Message ID 1541778262-11557-5-git-send-email-paolo.pisati@canonical.com
State New
Headers show
Series
  • RaspberryPi 3B+: fix ethernet leds
Related show

Commit Message

Paolo Pisati Nov. 9, 2018, 3:44 p.m.
BugLink: http://bugs.launchpad.net/bugs/1802320

This reverts commit 1111a9e0bd2ebab88e736d8a9773df2ec76dc52c.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 drivers/net/usb/lan78xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 0b3e6e2..bf68efb 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -619,7 +619,8 @@  static int lan78xx_read_otp(struct lan78xx_net *dev, u32 offset,
 			offset += 0x100;
 		else
 			ret = -EINVAL;
-		ret = lan78xx_read_raw_otp(dev, offset, length, data);
+		if (!ret)
+			ret = lan78xx_read_raw_otp(dev, offset, length, data);
 	}
 
 	return ret;