summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Thomsen <bruno.thomsen@gmail.com>2020-07-30 21:57:49 +0200
committerDavid S. Miller <davem@davemloft.net>2020-08-03 15:01:02 -0700
commite4d5efdd0bc43c63c64021147175800a1d58114f (patch)
tree226dab72a2f2a052aa07ef708f4aca9cd3d4930a
parentbb3831294cd50750806f2ce8d73317dc8feeda09 (diff)
net: mdio device: use flexible sleeping in reset function
MDIO device reset assert and deassert length was created by usleep_range() but that does not ensure optimal handling of all the different values from device tree properties. By switching to the new flexible sleeping helper function, fsleep(), 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>
-rw-r--r--drivers/net/phy/mdio_device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c
index 0f625a1b1644..0837319a52d7 100644
--- a/drivers/net/phy/mdio_device.c
+++ b/drivers/net/phy/mdio_device.c
@@ -132,7 +132,7 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value)
d = value ? mdiodev->reset_assert_delay : mdiodev->reset_deassert_delay;
if (d)
- usleep_range(d, d + max_t(unsigned int, d / 10, 100));
+ fsleep(d);
}
EXPORT_SYMBOL(mdio_device_reset);