diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-01-04 07:30:28 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-05 11:24:54 -0500 |
commit | a31e795a3b4d8808724c7ea80f382b0fda85be0f (patch) | |
tree | c19a7d37adab5c5d0198882027be918c20c1a5b8 /drivers/net/dsa/lan9303-core.c | |
parent | 7892ea23c98c8dd034d34075943dbba8185adaf7 (diff) | |
download | op-kernel-dev-a31e795a3b4d8808724c7ea80f382b0fda85be0f.zip op-kernel-dev-a31e795a3b4d8808724c7ea80f382b0fda85be0f.tar.gz |
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 <weiyongjun1@huawei.com>
Reviewed-by: Egil Hjelmeland <privat@egil-hjelmeland.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/lan9303-core.c')
-rw-r--r-- | drivers/net/dsa/lan9303-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 4efb772..2dead7f 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 |