Commit 601f574a authored by Jerry Ray's avatar Jerry Ray Committed by David S. Miller

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: default avatarJerry Ray <jerry.ray@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1bcb5df8
......@@ -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, &reg);
ret = lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, &reg);
if (ret)
return (ret);
reg &= ~LAN9303_VIRT_SPECIAL_TURBO;
regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment