mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/3] clk: ignore -EPROTO in clk_get_enabled_if_available
Date: Wed, 25 Mar 2026 12:42:47 +0100	[thread overview]
Message-ID: <20260325114753.2249763-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260325114753.2249763-1-a.fatoum@pengutronix.de>

Getting an SCMI clock can succeed with failure being postponed until the
driver attempts to enable the clock, at which time -EPROTO is returned.

Have clk_get_enabled_if_available() ignore that error code after
printing the warning, so the system can at least reach a shell.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/linux/clk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/clk.h b/include/linux/clk.h
index 1cb8a1898e10..dc96a584398c 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -1292,7 +1292,7 @@ static inline struct clk *clk_get_enabled_if_available(struct device *dev,
 	ret = clk_enable(clk);
 	if (ret) {
 		clk_put(clk);
-		return ERR_PTR(ret);
+		return ret == -EPROTO ? NULL : ERR_PTR(ret);
 	}
 
 	return clk;
-- 
2.47.3




  parent reply	other threads:[~2026-03-25 11:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 11:42 [PATCH 0/3] firmware: arm_scmi: clock: make more robust Ahmad Fatoum
2026-03-25 11:42 ` [PATCH 1/3] serial: introduce clk_get_enabled_for_console() Ahmad Fatoum
2026-03-25 11:42 ` Ahmad Fatoum [this message]
2026-03-25 11:42 ` [PATCH 3/3] firmware: arm_scmi: clock: sync with Linux v7.0 Ahmad Fatoum

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=20260325114753.2249763-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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