Message ID | 20231201150131.326766-2-heiko@sntech.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 9853294627237b73a6b765162d9c0485b0697db5 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: phy: micrel: additional clock handling | expand |
On 12/1/23 07:01, Heiko Stuebner wrote: > From: Heiko Stuebner <heiko.stuebner@cherry.de> > > 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 <heiko.stuebner@cherry.de> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
On Fri, Dec 01, 2023 at 04:01:30PM +0100, Heiko Stuebner wrote: > From: Heiko Stuebner <heiko.stuebner@cherry.de> > > 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 <heiko.stuebner@cherry.de> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 08e3915001c3..ec6a39dc9053 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -2001,7 +2001,7 @@ static int kszphy_probe(struct phy_device *phydev) kszphy_parse_led_mode(phydev); - clk = devm_clk_get(&phydev->mdio.dev, "rmii-ref"); + clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, "rmii-ref"); /* NOTE: clk may be NULL if building without CONFIG_HAVE_CLK */ if (!IS_ERR_OR_NULL(clk)) { unsigned long rate = clk_get_rate(clk);