Commit a18caa97 authored by Marco Felsch's avatar Marco Felsch Committed by Jakub Kicinski

net: phy: smsc: fix clk error handling

Commit bedd8d78 ("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: bedd8d78 ("net: phy: smsc: LAN8710/20: add phy refclk in support")
Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20210111085932.28680-1-m.felsch@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent df85bc14
......@@ -317,7 +317,8 @@ static int smsc_phy_probe(struct phy_device *phydev)
/* Make clk optional to keep DTB backward compatibility. */
priv->refclk = clk_get_optional(dev, NULL);
if (IS_ERR(priv->refclk))
dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n");
return dev_err_probe(dev, PTR_ERR(priv->refclk),
"Failed to request clock\n");
ret = clk_prepare_enable(priv->refclk);
if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment