Skip to content

Commit c312c78

Browse files
Andre-ARMdavem330
authored andcommitted
net: phy: mdio-bcm-unimac: Fix clock handling
The DT binding for this PHY describes an *optional* clock property. Due to a bug in the error handling logic, we are actually ignoring this clock *all* of the time so far. Fix this by using devm_clk_get_optional() to handle this clock properly. Fixes: b78ac6e ("net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider") Signed-off-by: Andre Przywara <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 50e0d28 commit c312c78

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/phy/mdio-bcm-unimac.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,9 @@ static int unimac_mdio_probe(struct platform_device *pdev)
242242
return -ENOMEM;
243243
}
244244

245-
priv->clk = devm_clk_get(&pdev->dev, NULL);
246-
if (PTR_ERR(priv->clk) == -EPROBE_DEFER)
245+
priv->clk = devm_clk_get_optional(&pdev->dev, NULL);
246+
if (IS_ERR(priv->clk))
247247
return PTR_ERR(priv->clk);
248-
else
249-
priv->clk = NULL;
250248

251249
ret = clk_prepare_enable(priv->clk);
252250
if (ret)

0 commit comments

Comments
 (0)