drivers/pinctrl/actions/pinctrl-owl.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
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
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
© 2016 - 2025 Red Hat, Inc.