mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Kees Cook <kees+treewide@kernel.org>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 1/2] ASoC: adi: axi-i2s: Use devm_clk_get_enabled()
Date: Tue, 17 Nov 2026 09:53:34 +0700	[thread overview]
Message-ID: <20261117025335.7455-2-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20261117025335.7455-1-phucduc.bui@gmail.com>

From: bui duc phuc <phucduc.bui@gmail.com>

The AXI clock is enabled once in probe() and only disabled in
remove(). Use devm_clk_get_enabled() to let devres handle this
automatically, and drop the now unnecessary remove() callback.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/adi/axi-i2s.c | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/sound/soc/adi/axi-i2s.c b/sound/soc/adi/axi-i2s.c
index 2c4035ff6c2d..1eeb96b7fd60 100644
--- a/sound/soc/adi/axi-i2s.c
+++ b/sound/soc/adi/axi-i2s.c
@@ -208,7 +208,7 @@ static int axi_i2s_probe(struct platform_device *pdev)
 	if (IS_ERR(i2s->regmap))
 		return PTR_ERR(i2s->regmap);
 
-	i2s->clk = devm_clk_get(&pdev->dev, "axi");
+	i2s->clk = devm_clk_get_enabled(&pdev->dev, "axi");
 	if (IS_ERR(i2s->clk))
 		return PTR_ERR(i2s->clk);
 
@@ -216,10 +216,6 @@ static int axi_i2s_probe(struct platform_device *pdev)
 	if (IS_ERR(i2s->clk_ref))
 		return PTR_ERR(i2s->clk_ref);
 
-	ret = clk_prepare_enable(i2s->clk);
-	if (ret)
-		return ret;
-
 	if (i2s->has_playback) {
 		axi_i2s_dai.playback.channels_min = 2;
 		axi_i2s_dai.playback.channels_max = 2;
@@ -257,28 +253,17 @@ static int axi_i2s_probe(struct platform_device *pdev)
 	ret = devm_snd_soc_register_component(&pdev->dev, &axi_i2s_component,
 					 &axi_i2s_dai, 1);
 	if (ret)
-		goto err_clk_disable;
+		return ret;
 
 	ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
 	if (ret)
-		goto err_clk_disable;
+		return ret;
 
 	dev_info(&pdev->dev, "probed, capture %s, playback %s\n",
 		 str_enabled_disabled(i2s->has_capture),
 		 str_enabled_disabled(i2s->has_playback));
 
 	return 0;
-
-err_clk_disable:
-	clk_disable_unprepare(i2s->clk);
-	return ret;
-}
-
-static void axi_i2s_dev_remove(struct platform_device *pdev)
-{
-	struct axi_i2s *i2s = platform_get_drvdata(pdev);
-
-	clk_disable_unprepare(i2s->clk);
 }
 
 static const struct of_device_id axi_i2s_of_match[] = {
@@ -293,7 +278,6 @@ static struct platform_driver axi_i2s_driver = {
 		.of_match_table = axi_i2s_of_match,
 	},
 	.probe = axi_i2s_probe,
-	.remove = axi_i2s_dev_remove,
 };
 module_platform_driver(axi_i2s_driver);
 
-- 
2.43.0


  reply	other threads:[~2026-11-17  2:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  2:53 [PATCH 0/2] ASoC: adi: " phucduc.bui
2026-11-17  2:53 ` phucduc.bui [this message]
2026-11-17  2:53 ` [PATCH 2/2] ASoC: adi: axi-spdif: " phucduc.bui

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=20261117025335.7455-2-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=broonie@kernel.org \
    --cc=kees+treewide@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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®