mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-19 12:00:00 +00:00
net: marvell: mvmdio: use clk_get_optional
The code seems to be handling EPROBE_DEFER explicitly and if there's no error, enables the clock. clk_get_optional exists for that. Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20240930211628.330703-1-rosenp@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b7074e4375
commit
4c5107b8f5
@ -348,13 +348,12 @@ static int orion_mdio_probe(struct platform_device *pdev)
|
|||||||
if (type == BUS_TYPE_XSMI)
|
if (type == BUS_TYPE_XSMI)
|
||||||
orion_mdio_xsmi_set_mdc_freq(bus);
|
orion_mdio_xsmi_set_mdc_freq(bus);
|
||||||
} else {
|
} else {
|
||||||
dev->clk[0] = clk_get(&pdev->dev, NULL);
|
dev->clk[0] = clk_get_optional(&pdev->dev, NULL);
|
||||||
if (PTR_ERR(dev->clk[0]) == -EPROBE_DEFER) {
|
if (IS_ERR(dev->clk[0])) {
|
||||||
ret = -EPROBE_DEFER;
|
ret = PTR_ERR(dev->clk[0]);
|
||||||
goto out_clk;
|
goto out_clk;
|
||||||
}
|
}
|
||||||
if (!IS_ERR(dev->clk[0]))
|
clk_prepare_enable(dev->clk[0]);
|
||||||
clk_prepare_enable(dev->clk[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -422,8 +421,6 @@ static void orion_mdio_remove(struct platform_device *pdev)
|
|||||||
mdiobus_unregister(bus);
|
mdiobus_unregister(bus);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
|
for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
|
||||||
if (IS_ERR(dev->clk[i]))
|
|
||||||
break;
|
|
||||||
clk_disable_unprepare(dev->clk[i]);
|
clk_disable_unprepare(dev->clk[i]);
|
||||||
clk_put(dev->clk[i]);
|
clk_put(dev->clk[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user