Skip to content

Commit

Permalink
net: dsa: lan9303: Fix error return code in lan9303_check_device()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Jan 5, 2018
1 parent 7892ea2 commit a31e795
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/lan9303-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a31e795

Please sign in to comment.