Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: smsc: fix clk error handling

Commit bedd8d78aba3 ("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: bedd8d78aba3 ("net: phy: smsc: LAN8710/20: add phy refclk in support")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20210111085932.28680-1-m.felsch@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Marco Felsch and committed by
Jakub Kicinski
a18caa97 df85bc14

+2 -1
+2 -1
drivers/net/phy/smsc.c
··· 317 317 /* Make clk optional to keep DTB backward compatibility. */ 318 318 priv->refclk = clk_get_optional(dev, NULL); 319 319 if (IS_ERR(priv->refclk)) 320 - dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n"); 320 + return dev_err_probe(dev, PTR_ERR(priv->refclk), 321 + "Failed to request clock\n"); 321 322 322 323 ret = clk_prepare_enable(priv->refclk); 323 324 if (ret)