Skip to content

Commit 9853294

Browse files
Heiko Stuebnerkuba-moo
authored andcommitted
net: phy: micrel: use devm_clk_get_optional_enabled for the rmii-ref clock
While the external clock input will most likely be enabled, it's not guaranteed and clk_get_rate in some suppliers will even just return valid results when the clock is running. So use devm_clk_get_optional_enabled to retrieve and enable the clock in one go. Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8ad55b1 commit 9853294

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/phy/micrel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ static int kszphy_probe(struct phy_device *phydev)
20012001

20022002
kszphy_parse_led_mode(phydev);
20032003

2004-
clk = devm_clk_get(&phydev->mdio.dev, "rmii-ref");
2004+
clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, "rmii-ref");
20052005
/* NOTE: clk may be NULL if building without CONFIG_HAVE_CLK */
20062006
if (!IS_ERR_OR_NULL(clk)) {
20072007
unsigned long rate = clk_get_rate(clk);

0 commit comments

Comments
 (0)