Skip to content

Commit a31e795

Browse files
Wei Yongjundavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Egil Hjelmeland <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7892ea2 commit a31e795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/dsa/lan9303-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ static int lan9303_check_device(struct lan9303 *chip)
865865
if ((reg >> 16) != LAN9303_CHIP_ID) {
866866
dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n",
867867
reg >> 16);
868-
return ret;
868+
return -ENODEV;
869869
}
870870

871871
/* The default state of the LAN9303 device is to forward packets between

0 commit comments

Comments
 (0)