From: Markus Elfring <Markus.Elfring@web.de>
To: linux-serial@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Joachim Knorr" <joachim.knorr@ziehl-abegg.de>,
"Luca Fresi" <luca.fresi@bithiatec.com>,
"Martin Fuzzey" <martin.fuzzey@flowbird.group>,
"Paul Mbewe" <paultyson.mbewe@ziehl-abegg.de>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] serial: sc16is7xx: Use devm_clk_get_optional_enabled() in sc16is7xx_probe()
Date: Thu, 19 Nov 2026 18:12:33 +0100 [thread overview]
Message-ID: <1333a82f-d074-487b-b3ad-c1a3496b312b@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 19 Nov 2026 18:04:56 +0100
Reuse existing functionality from devm_clk_get_optional_enabled()
instead of keeping duplicate source code.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/sc16is7xx.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index dbf38825a78c..3af8ea93b34a 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1605,14 +1605,10 @@ int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype,
dev_dbg(dev,
"No interrupt pin definition, falling back to polling mode\n");
- s->clk = devm_clk_get_optional(dev, NULL);
+ s->clk = devm_clk_get_optional_enabled(dev, NULL);
if (IS_ERR(s->clk))
return PTR_ERR(s->clk);
- ret = clk_prepare_enable(s->clk);
- if (ret)
- return ret;
-
freq = clk_get_rate(s->clk);
if (freq == 0) {
if (uartclk)
--
2.56.1
next reply other threads:[~2026-11-19 17:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 17:12 Markus Elfring [this message]
2026-11-19 17:36 ` Hugo Villeneuve
2026-11-19 17:43 ` Markus Elfring
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=1333a82f-d074-487b-b3ad-c1a3496b312b@web.de \
--to=markus.elfring@web.de \
--cc=gregkh@linuxfoundation.org \
--cc=hvilleneuve@dimonoff.com \
--cc=jirislaby@kernel.org \
--cc=joachim.knorr@ziehl-abegg.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=luca.fresi@bithiatec.com \
--cc=martin.fuzzey@flowbird.group \
--cc=paultyson.mbewe@ziehl-abegg.de \
--cc=u.kleine-koenig@baylibre.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
all inboxes | Powered by JetHome®