alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: broonie@opensource.wolfsonmicro.com
Cc: Fabio Estevam <fabio.estevam@freescale.com>, alsa-devel@alsa-project.org
Subject: [PATCH 1/2] ASoC: fsl: imx-sgtl5000: Use devm_clk_get()
Date: Tue, 12 Mar 2013 20:51:29 -0300	[thread overview]
Message-ID: <1363132289-15211-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1363132289-15211-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

Using devm_clk_get() can make the code smaller and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/imx-sgtl5000.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 424347e..74a4628 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -128,7 +128,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
 		goto fail;
 	}
 
-	data->codec_clk = clk_get(&codec_dev->dev, NULL);
+	data->codec_clk = devm_clk_get(&codec_dev->dev, NULL);
 	if (IS_ERR(data->codec_clk)) {
 		/* assuming clock enabled by default */
 		data->codec_clk = NULL;
@@ -175,7 +175,6 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, data);
 clk_fail:
-	clk_put(data->codec_clk);
 fail:
 	if (ssi_np)
 		of_node_put(ssi_np);
@@ -189,10 +188,9 @@ static int imx_sgtl5000_remove(struct platform_device *pdev)
 {
 	struct imx_sgtl5000_data *data = platform_get_drvdata(pdev);
 
-	if (data->codec_clk) {
+	if (data->codec_clk)
 		clk_disable_unprepare(data->codec_clk);
-		clk_put(data->codec_clk);
-	}
+
 	snd_soc_unregister_card(&data->card);
 
 	return 0;
-- 
1.7.9.5

  reply	other threads:[~2013-03-12 23:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 23:51 [PATCH 2/2] ASoC: fsl: imx-audmux: Use devm_clk_get() Fabio Estevam
2013-03-12 23:51 ` Fabio Estevam [this message]
2013-03-13 10:39   ` [PATCH 1/2] ASoC: fsl: imx-sgtl5000: " Mark Brown
2013-03-13 10:39 ` [PATCH 2/2] ASoC: fsl: imx-audmux: " 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=1363132289-15211-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=fabio.estevam@freescale.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;
as well as URLs for NNTP newsgroup(s).