diff mbox series

[net-next] net: dsa: lan9303: Fix error return code in lan9303_check_device()

Message ID 1515051028-59363-1-git-send-email-weiyongjun1@huawei.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net-next] net: dsa: lan9303: Fix error return code in lan9303_check_device() | expand

Commit Message

Wei Yongjun Jan. 4, 2018, 7:30 a.m. UTC
Fix to return error code -ENODEV from the chip not found error handling
case instead of 0(ret have been overwritten to 0 by lan9303_read()), as
done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/dsa/lan9303-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Egil Hjelmeland Jan. 4, 2018, 10:04 a.m. UTC | #1
Den 04. jan. 2018 08:30, skrev Wei Yongjun:
> Fix to return error code -ENODEV from the chip not found error handling
> case instead of 0(ret have been overwritten to 0 by lan9303_read()), as
> done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---

Reviewed-by: Egil Hjelmeland <privat@egil-hjelmeland.no>

Egil
David Miller Jan. 5, 2018, 4:25 p.m. UTC | #2
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Thu, 4 Jan 2018 07:30:28 +0000

> Fix to return error code -ENODEV from the chip not found error handling
> case instead of 0(ret have been overwritten to 0 by lan9303_read()), as
> done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index 944901f..d4a5b45 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -867,7 +867,7 @@  static int lan9303_check_device(struct lan9303 *chip)
 	if ((reg >> 16) != LAN9303_CHIP_ID) {
 		dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n",
 			reg >> 16);
-		return ret;
+		return -ENODEV;
 	}
 
 	/* The default state of the LAN9303 device is to forward packets between