summaryrefslogtreecommitdiff
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorJerry Ray <jerry.ray@microchip.com>2023-01-17 23:57:00 +0300
committerDavid S. Miller <davem@davemloft.net>2023-01-20 11:53:13 +0300
commitde375aa860fb848eaabc76dce0af2e982630b421 (patch)
treed9768734286346b600250006dc7a5dc1134f70af /drivers/net/dsa
parent601f574a1b449446a98d65cc3871a8eb2cb18bcf (diff)
downloadlinux-de375aa860fb848eaabc76dce0af2e982630b421.tar.xz
dsa: lan9303: write reg only if necessary
As the regmap_write() is over a slow bus that will sleep, we can speed up the boot-up time a bit by not bothering to clear a bit that is already clear. Signed-off-by: Jerry Ray <jerry.ray@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/lan9303-core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index 66466d50d015..a4decf42a002 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -915,8 +915,11 @@ static int lan9303_setup(struct dsa_switch *ds)
if (ret)
return (ret);
- reg &= ~LAN9303_VIRT_SPECIAL_TURBO;
- regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg);
+ /* Clear the TURBO Mode bit if it was set. */
+ if (reg & LAN9303_VIRT_SPECIAL_TURBO) {
+ reg &= ~LAN9303_VIRT_SPECIAL_TURBO;
+ regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg);
+ }
ret = lan9303_setup_tagging(chip);
if (ret)