From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Alexander Sverdlin <alexander.sverdlin@siemens.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 2/2] gpio: omap: save two lines by using devm_clk_get_prepared()
Date: Tue, 3 Dec 2024 17:41:43 +0100 [thread overview]
Message-ID: <20241203164143.29852-2-brgl@bgdev.pl> (raw)
In-Reply-To: <20241203164143.29852-1-brgl@bgdev.pl>
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
We can drop the else branch if we get the clock already prepared using
the relevant helper.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-omap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 54c4bfdccf568..57d299d5d0b16 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1449,13 +1449,11 @@ static int omap_gpio_probe(struct platform_device *pdev)
}
if (bank->dbck_flag) {
- bank->dbck = devm_clk_get(dev, "dbclk");
+ bank->dbck = devm_clk_get_prepared(dev, "dbclk");
if (IS_ERR(bank->dbck)) {
dev_err(dev,
"Could not get gpio dbck. Disable debounce\n");
bank->dbck_flag = false;
- } else {
- clk_prepare(bank->dbck);
}
}
--
2.45.2
next prev parent reply other threads:[~2024-12-03 16:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 16:41 [PATCH 1/2] gpio: omap: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
2024-12-03 16:41 ` Bartosz Golaszewski [this message]
2024-12-03 18:19 ` [PATCH 2/2] gpio: omap: save two lines by using devm_clk_get_prepared() Sverdlin, Alexander
2024-12-13 12:16 ` Matti Vaittinen
2024-12-13 12:29 ` Sverdlin, Alexander
2024-12-13 13:17 ` Bartosz Golaszewski
2024-12-13 13:55 ` Matti Vaittinen
2024-12-16 8:57 ` Sverdlin, Alexander
2024-12-16 11:11 ` Matti Vaittinen
2024-12-16 11:14 ` Matti Vaittinen
2024-12-16 11:27 ` Sverdlin, Alexander
2024-12-03 18:18 ` [PATCH 1/2] gpio: omap: allow building the module with COMPILE_TEST=y Sverdlin, Alexander
2024-12-03 18:41 ` Andrew Davis
2024-12-03 20:36 ` Bartosz Golaszewski
2024-12-03 21:54 ` Andrew Davis
2024-12-05 10:27 ` Bartosz Golaszewski
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=20241203164143.29852-2-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=alexander.sverdlin@siemens.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=grygorii.strashko@ti.com \
--cc=khilman@kernel.org \
--cc=linus.walleij@linaro.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