Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bruno Thomsen and committed by
David S. Miller
e4d5efdd bb383129

+1 -1
+1 -1
drivers/net/phy/mdio_device.c
··· 132 132 133 133 d = value ? mdiodev->reset_assert_delay : mdiodev->reset_deassert_delay; 134 134 if (d) 135 - usleep_range(d, d + max_t(unsigned int, d / 10, 100)); 135 + fsleep(d); 136 136 } 137 137 EXPORT_SYMBOL(mdio_device_reset); 138 138