mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Jian <lazycat-xiao@foxmail.com>
To: linux-kernel@vger.kernel.org
Cc: lgirdwood@gmail.com, loongarch@vger.kernel.org,
	chenhuacai@loongson.cn, zhoubinbin@loongson.cn, jeffbai@aosc.io,
	"Li Jian" <lazycat-xiao@foxmail.com>,
	stable@vger.kernel.org, "Mark Brown" <broonie@kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Zhang Yi" <zhangyi@everest-semi.com>,
	"Charles Keepax" <ckeepax@opensource.cirrus.com>,
	"Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>,
	"Alexandru Ardelean" <aardelean@deviqon.com>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-sound@vger.kernel.org
Subject: [PATCH] ASoC: ES8389: convert to devm_clk_get_optional() to get clock
Date: Fri, 17 Apr 2026 18:53:14 +0800	[thread overview]
Message-ID: <tencent_7C78374FB9F4B3A37101E5C719715D8BC40A@qq.com> (raw)

When enabling ES8390 via ACPI description, es8389 would fail to
obtain a clock source, causing the driver to fail to initialize.
This was not an issue with older kernels, but since commit
abae8e57e49a ("clk: generalize devm_clk_get() a bit"),
devm_clk_get() would return an error pointer when a clock source
was not detected (instead of falling back to a static clock),
causing the driver to fail early.

Use devm_clk_get_optional() instead to return to the previous
behaviour, allowing the use of a static clock source.

Cc: stable@vger.kernel.org
Fixes: abae8e57e49a ("clk: generalize devm_clk_get() a bit")
Signed-off-by: Li Jian <lazycat-xiao@foxmail.com>
---
 sound/soc/codecs/es8389.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index 8d418cae3..449d9574b 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -892,7 +892,7 @@ static int es8389_probe(struct snd_soc_component *component)
 		return ret;
 	}
 
-	es8389->mclk = devm_clk_get(component->dev, "mclk");
+	es8389->mclk = devm_clk_get_optional(component->dev, "mclk");
 	if (IS_ERR(es8389->mclk))
 		return dev_err_probe(component->dev, PTR_ERR(es8389->mclk),
 			"ES8389 is unable to get mclk\n");
-- 
2.47.3


             reply	other threads:[~2026-04-17 10:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 10:53 Li Jian [this message]
2026-04-17 13:34 ` Uwe Kleine-König
2026-04-18  8:18   ` Li Jian
2026-04-18 11:40     ` Uwe Kleine-König
2026-04-26 23:30 ` Mark Brown
2026-04-27 17:00   ` Uwe Kleine-König
2026-04-28  0:03     ` Mark Brown

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=tencent_7C78374FB9F4B3A37101E5C719715D8BC40A@qq.com \
    --to=lazycat-xiao@foxmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=aardelean@deviqon.com \
    --cc=broonie@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=jeffbai@aosc.io \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=loongarch@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sboyd@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=zhangyi@everest-semi.com \
    --cc=zhoubinbin@loongson.cn \
    /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®