Skip to content

Commit

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

Expand Down

0 comments on commit 6259e0f

Please sign in to comment.