The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Cong Nguyen <congnt264@gmail.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>
Cc: Alexander Sverdlin <alexander.sverdlin@siemens.com>,
	Jiawen Liu <1298662399@qq.com>,
	linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] gpio: omap: do not unprepare the debounce clock twice on probe failure
Date: Tue, 24 Nov 2026 15:52:31 +0700	[thread overview]
Message-ID: <20261124085231.3696739-1-congnt264@gmail.com> (raw)

The debounce clock is now obtained with devm_clk_get_prepared(), so
devres unprepares it when probe fails or the device is unbound. The error
path added for a failing pm_runtime_resume_and_get() still calls
clk_unprepare() on the same clock by hand.

When pm_runtime_resume_and_get() fails and a debounce clock is present,
the clock is unprepared twice. The second clk_unprepare() warns that the
clock is already unprepared.

Drop the manual clk_unprepare().

This issue was found by auditing the driver with an LLM coding assistant.

Fixes: 9df982f1f283 ("gpio: omap: handle debounce clock preparation failure")
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
 drivers/gpio/gpio-omap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 0da628ae77be..0af26c3f7197 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1463,8 +1463,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0) {
 		pm_runtime_disable(dev);
-		if (bank->dbck_flag)
-			clk_unprepare(bank->dbck);
 		return ret;
 	}
 
-- 
2.25.1


             reply	other threads:[~2026-11-24  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  8:52 Cong Nguyen [this message]
2026-11-24  9:30 ` [PATCH] gpio: omap: do not unprepare the debounce clock twice on probe failure Andreas Kemnade
2026-11-24  9:33 ` Sverdlin, Alexander

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=20261124085231.3696739-1-congnt264@gmail.com \
    --to=congnt264@gmail.com \
    --cc=1298662399@qq.com \
    --cc=alexander.sverdlin@siemens.com \
    --cc=brgl@kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=khilman@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ssantosh@kernel.org \
    /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