* [PATCH] pinctrl: actions: use devm_clk_get_enabled()
@ 2025-06-24 6:22 Qi Han
2025-06-24 8:15 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Qi Han @ 2025-06-24 6:22 UTC (permalink / raw)
To: linus.walleij, afaerber, mani
Cc: linux-gpio, linux-arm-kernel, linux-actions, linux-kernel, Qi Han
Use devm_clk_get_enabled() to simplify the code.
Change-Id: I0902c50e50db565381c65e8d8a7f1481e82b271a
Signed-off-by: Qi Han <hanqi@vivo.com>
---
drivers/pinctrl/actions/pinctrl-owl.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c
index 86f3d5c69e36..a66739a27489 100644
--- a/drivers/pinctrl/actions/pinctrl-owl.c
+++ b/drivers/pinctrl/actions/pinctrl-owl.c
@@ -941,18 +941,13 @@ int owl_pinctrl_probe(struct platform_device *pdev,
return PTR_ERR(pctrl->base);
/* enable GPIO/MFP clock */
- pctrl->clk = devm_clk_get(&pdev->dev, NULL);
+ pctrl->clk = devm_clk_get_enabled(&pdev->dev, NULL);
+
if (IS_ERR(pctrl->clk)) {
dev_err(&pdev->dev, "no clock defined\n");
return PTR_ERR(pctrl->clk);
}
- ret = clk_prepare_enable(pctrl->clk);
- if (ret) {
- dev_err(&pdev->dev, "clk enable failed\n");
- return ret;
- }
-
raw_spin_lock_init(&pctrl->lock);
owl_pinctrl_desc.name = dev_name(&pdev->dev);
@@ -1006,7 +1001,5 @@ int owl_pinctrl_probe(struct platform_device *pdev,
return 0;
err_exit:
- clk_disable_unprepare(pctrl->clk);
-
return ret;
}
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: actions: use devm_clk_get_enabled()
2025-06-24 6:22 [PATCH] pinctrl: actions: use devm_clk_get_enabled() Qi Han
@ 2025-06-24 8:15 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-24 8:15 UTC (permalink / raw)
To: Qi Han, linus.walleij, afaerber, mani
Cc: linux-gpio, linux-arm-kernel, linux-actions, linux-kernel
On 24/06/2025 08:22, Qi Han wrote:
> Use devm_clk_get_enabled() to simplify the code.
>
> Change-Id: I0902c50e50db565381c65e8d8a7f1481e82b271a
Please run scripts/checkpatch.pl on the patches and fix reported
warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
patches and (probably) fix more warnings. Some warnings can be ignored,
especially from --strict run, but the code here looks like it needs a
fix. Feel free to get in touch if the warning is not clear.
> Signed-off-by: Qi Han <hanqi@vivo.com>
> ---
> drivers/pinctrl/actions/pinctrl-owl.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c
> index 86f3d5c69e36..a66739a27489 100644
> --- a/drivers/pinctrl/actions/pinctrl-owl.c
> +++ b/drivers/pinctrl/actions/pinctrl-owl.c
> @@ -941,18 +941,13 @@ int owl_pinctrl_probe(struct platform_device *pdev,
> return PTR_ERR(pctrl->base);
>
> /* enable GPIO/MFP clock */
> - pctrl->clk = devm_clk_get(&pdev->dev, NULL);
> + pctrl->clk = devm_clk_get_enabled(&pdev->dev, NULL);
> +
Why are you introducing whitespace changes?
Are you sure that you are not introducing same bugs as other vivo
patches? Do you understand the issue with this scripting work?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-24 8:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 6:22 [PATCH] pinctrl: actions: use devm_clk_get_enabled() Qi Han
2025-06-24 8:15 ` Krzysztof Kozlowski
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).