* [PATCH net-next] net: marvell: mvmdio: use clk_get_optional
@ 2024-09-30 21:16 Rosen Penev
2024-09-30 21:33 ` Andrew Lunn
2024-10-04 0:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2024-09-30 21:16 UTC (permalink / raw)
To: netdev
Cc: andrew, davem, edumazet, kuba, pabeni, linux-kernel, tobias,
anna-maria
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>
---
drivers/net/ethernet/marvell/mvmdio.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index e1d003fdbc2e..67378e9f538a 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -348,13 +348,12 @@ static int orion_mdio_probe(struct platform_device *pdev)
if (type == BUS_TYPE_XSMI)
orion_mdio_xsmi_set_mdc_freq(bus);
} else {
- dev->clk[0] = clk_get(&pdev->dev, NULL);
- if (PTR_ERR(dev->clk[0]) == -EPROBE_DEFER) {
- ret = -EPROBE_DEFER;
+ dev->clk[0] = clk_get_optional(&pdev->dev, NULL);
+ if (IS_ERR(dev->clk[0])) {
+ ret = PTR_ERR(dev->clk[0]);
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);
for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
- if (IS_ERR(dev->clk[i]))
- break;
clk_disable_unprepare(dev->clk[i]);
clk_put(dev->clk[i]);
}
--
2.46.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: marvell: mvmdio: use clk_get_optional
2024-09-30 21:16 [PATCH net-next] net: marvell: mvmdio: use clk_get_optional Rosen Penev
@ 2024-09-30 21:33 ` Andrew Lunn
2024-10-04 0:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2024-09-30 21:33 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, davem, edumazet, kuba, pabeni, linux-kernel, tobias,
anna-maria
On Mon, Sep 30, 2024 at 02:16:28PM -0700, Rosen Penev wrote:
> The code seems to be handling EPROBE_DEFER explicitly and if there's no
> error, enables the clock. clk_get_optional exists for that.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: marvell: mvmdio: use clk_get_optional
2024-09-30 21:16 [PATCH net-next] net: marvell: mvmdio: use clk_get_optional Rosen Penev
2024-09-30 21:33 ` Andrew Lunn
@ 2024-10-04 0:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-04 0:20 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, andrew, davem, edumazet, kuba, pabeni, linux-kernel,
tobias, anna-maria
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 30 Sep 2024 14:16:28 -0700 you wrote:
> 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>
> ---
> drivers/net/ethernet/marvell/mvmdio.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
Here is the summary with links:
- [net-next] net: marvell: mvmdio: use clk_get_optional
https://git.kernel.org/netdev/net-next/c/4c5107b8f508
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-04 0:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30 21:16 [PATCH net-next] net: marvell: mvmdio: use clk_get_optional Rosen Penev
2024-09-30 21:33 ` Andrew Lunn
2024-10-04 0:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).