summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/lan9303-core.c
diff options
context:
space:
mode:
authorJerry Ray <jerry.ray@microchip.com>2023-01-17 14:56:59 -0600
committerDavid S. Miller <davem@davemloft.net>2023-01-20 08:53:13 +0000
commit601f574a1b449446a98d65cc3871a8eb2cb18bcf (patch)
treed932d3af47d91408c8a9e45e8ebf1562435eafc7 /drivers/net/dsa/lan9303-core.c
parent1bcb5df81e4b788d3a0ff5b04dc5299758b38ac5 (diff)
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>
Diffstat (limited to 'drivers/net/dsa/lan9303-core.c')
-rw-r--r--drivers/net/dsa/lan9303-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index 63f5c1ef65e2..66466d50d015 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -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);