From: Wei Yongjun Date: Thu, 4 Jan 2018 07:30:28 +0000 (+0000) Subject: net: dsa: lan9303: Fix error return code in lan9303_check_device() X-Git-Tag: v4.16-rc1~123^2~231 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a31e795a3b4d8808724c7ea80f382b0fda85be0f;p=users%2Fjedix%2Flinux-maple.git net: dsa: lan9303: Fix error return code in lan9303_check_device() 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 Reviewed-by: Egil Hjelmeland Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 4efb772dbc7e..2dead7fa1f93 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -865,7 +865,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