Skip to content

Commit c469b23

Browse files
Marco Felschgregkh
Marco Felsch
authored andcommitted
net: phy: smsc: fix clk error handling
[ Upstream commit a18caa9 ] Commit bedd8d7 ("net: phy: smsc: LAN8710/20: add phy refclk in support") added the phy clk support. The commit already checks if clk_get_optional() throw an error but instead of returning the error it ignores it. Fixes: bedd8d7 ("net: phy: smsc: LAN8710/20: add phy refclk in support") Suggested-by: Jakub Kicinski <[email protected]> Signed-off-by: Marco Felsch <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ad2175c commit c469b23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/phy/smsc.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ static int smsc_phy_probe(struct phy_device *phydev)
284284
/* Make clk optional to keep DTB backward compatibility. */
285285
priv->refclk = clk_get_optional(dev, NULL);
286286
if (IS_ERR(priv->refclk))
287-
dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n");
287+
return dev_err_probe(dev, PTR_ERR(priv->refclk),
288+
"Failed to request clock\n");
288289

289290
ret = clk_prepare_enable(priv->refclk);
290291
if (ret)

0 commit comments

Comments
 (0)