From: Markus Elfring <Markus.Elfring@web.de>
To: linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Linus Walleij <linusw@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
Florian Fainelli <f.fainelli@gmail.com>,
Frank Li <Frank.Li@kernel.org>,
Michal Simek <michal.simek@amd.com>
Subject: [PATCH] pinctrl: renesas: rzn1: Use devm_clk_get_enabled() in rzn1_pinctrl_probe()
Date: Mon, 23 Nov 2026 14:04:23 +0100 [thread overview]
Message-ID: <e05bd9db-c855-4972-86bb-3b7346cdd278@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 23 Nov 2026 13:56:29 +0100
* Reuse existing functionality from devm_clk_get_enabled() instead of
keeping duplicate source code.
* Delete a clk_disable_unprepare() call on an error handling path
and in the implementation of the function “rzn1_pinctrl_remove”.
* Omit the label “err_clk”.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/pinctrl/renesas/pinctrl-rzn1.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c
index d8422d740433..a6dfcd4e31ae 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
@@ -869,12 +869,9 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
return PTR_ERR(ipctl->lev2);
ipctl->lev2_protect_phys = (u32)res->start + 0x400;
- ipctl->clk = devm_clk_get(&pdev->dev, NULL);
+ ipctl->clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(ipctl->clk))
return PTR_ERR(ipctl->clk);
- ret = clk_prepare_enable(ipctl->clk);
- if (ret)
- return ret;
ipctl->dev = &pdev->dev;
rzn1_pinctrl_desc.name = dev_name(&pdev->dev);
@@ -882,7 +879,7 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
ret = rzn1_pinctrl_probe_dt(pdev, ipctl);
if (ret) {
dev_err(&pdev->dev, "fail to probe dt properties\n");
- goto err_clk;
+ return ret;
}
platform_set_drvdata(pdev, ipctl);
@@ -891,28 +888,20 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
ipctl, &ipctl->pctl);
if (ret) {
dev_err(&pdev->dev, "could not register rzn1 pinctrl driver\n");
- goto err_clk;
+ return ret;
}
ret = pinctrl_enable(ipctl->pctl);
if (ret)
- goto err_clk;
+ return ret;
dev_info(&pdev->dev, "probed\n");
return 0;
-
-err_clk:
- clk_disable_unprepare(ipctl->clk);
-
- return ret;
}
static void rzn1_pinctrl_remove(struct platform_device *pdev)
{
- struct rzn1_pinctrl *ipctl = platform_get_drvdata(pdev);
-
- clk_disable_unprepare(ipctl->clk);
}
static const struct of_device_id rzn1_pinctrl_match[] = {
--
2.56.1
next reply other threads:[~2026-11-23 13:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 13:04 Markus Elfring [this message]
2026-11-23 13:10 ` [PATCH] pinctrl: renesas: rzn1: Use devm_clk_get_enabled() in rzn1_pinctrl_probe() sashiko-bot
2026-11-23 13:12 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e05bd9db-c855-4972-86bb-3b7346cdd278@web.de \
--to=markus.elfring@web.de \
--cc=Frank.Li@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=f.fainelli@gmail.com \
--cc=geert+renesas@glider.be \
--cc=kernel-janitors@vger.kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=michal.simek@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox