mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
dsa: lan9303: Add exception logic for read failure
While it is highly unlikely a read will ever fail, This code fragment is now in a function that allows us to return an error code. A read failure here will cause the lan9303_probe to fail. Signed-off-by: Jerry Ray <jerry.ray@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1bcb5df81e
commit
601f574a1b
|
|
@ -911,7 +911,9 @@ static int lan9303_setup(struct dsa_switch *ds)
|
|||
}
|
||||
|
||||
/* Virtual Phy: Remove Turbo 200Mbit mode */
|
||||
lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ®);
|
||||
ret = lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ®);
|
||||
if (ret)
|
||||
return (ret);
|
||||
|
||||
reg &= ~LAN9303_VIRT_SPECIAL_TURBO;
|
||||
regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user