Skip to content

Commit

Permalink
net: mdio device: use flexible sleeping in reset function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bruno Thomsen authored and David S. Miller committed Aug 3, 2020
1 parent bb38312 commit e4d5efd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/mdio_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e4d5efd

Please sign in to comment.