summaryrefslogtreecommitdiff
path: root/drivers/net/phy/mdio_bus.c
diff options
context:
space:
mode:
authorBruno Thomsen <bruno.thomsen@gmail.com>2020-07-30 21:57:47 +0200
committerDavid S. Miller <davem@davemloft.net>2020-08-03 15:01:02 -0700
commit6259e0f5478d7a7e4ff3e38bc739b612b8907246 (patch)
tree31548938bd556678eb670baee20d68626cd61f9d /drivers/net/phy/mdio_bus.c
parentc44a1b91753e54a9e9381ac6411ec36389d21453 (diff)
net: mdiobus: use flexible sleeping for reset-delay-us
MDIO bus reset pulse width is created by using udelay() and that function might not be optimal depending on device tree value. By switching to the new fsleep() helper the correct delay function is called depending on delay length, e.g. udelay(), usleep_range() or msleep(). Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio_bus.c')
-rw-r--r--drivers/net/phy/mdio_bus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 46b33701ad4b..5df3782b05b4 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -554,7 +554,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
bus->reset_gpiod = gpiod;
gpiod_set_value_cansleep(gpiod, 1);
- udelay(bus->reset_delay_us);
+ fsleep(bus->reset_delay_us);
gpiod_set_value_cansleep(gpiod, 0);
}