From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
alsa-devel@alsa-project.org, shawn.guo@linaro.org,
kernel@pengutronix.de
Subject: [PATCH v2 4/4] ASoC: imx-sgtl5000: Convert to devm_clk_get()
Date: Wed, 24 Apr 2013 11:54:46 -0300 [thread overview]
Message-ID: <1366815286-31820-4-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1366815286-31820-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
Converting to devm_clk_get() can simplify the code a bit.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- None
sound/soc/fsl/imx-sgtl5000.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 18af815..c869996 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -137,7 +137,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)) {
ret = PTR_ERR(data->codec_clk);
dev_err(&codec_dev->dev, "could not get codec clk: %d\n", ret);
@@ -186,7 +186,6 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
clk_fail:
clk_disable_unprepare(data->codec_clk);
- clk_put(data->codec_clk);
fail:
if (ssi_np)
of_node_put(ssi_np);
@@ -200,10 +199,7 @@ static int imx_sgtl5000_remove(struct platform_device *pdev)
{
struct imx_sgtl5000_data *data = platform_get_drvdata(pdev);
- if (data->codec_clk) {
- clk_disable_unprepare(data->codec_clk);
- clk_put(data->codec_clk);
- }
+ clk_disable_unprepare(data->codec_clk);
snd_soc_unregister_card(&data->card);
return 0;
--
1.7.9.5
next prev parent reply other threads:[~2013-04-24 14:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 14:54 [PATCH v2 1/4] ASoC: imx-sgtl5000: Do not enter the error path on success Fabio Estevam
2013-04-24 14:54 ` [PATCH v2 2/4] ASoC: imx-sgtl5000: Let the code clock be a mandatory binding Fabio Estevam
2013-04-25 5:16 ` Shawn Guo
2013-04-25 11:01 ` Mark Brown
2013-04-25 14:35 ` Shawn Guo
2013-05-01 16:53 ` Mark Brown
2013-05-02 2:04 ` Shawn Guo
2013-04-24 14:54 ` [PATCH v2 3/4] ASoC: imx-sgtl5000: Do a sanity check on the codec clock Fabio Estevam
2013-04-25 5:20 ` Shawn Guo
2013-04-24 14:54 ` Fabio Estevam [this message]
2013-04-25 5:21 ` [PATCH v2 4/4] ASoC: imx-sgtl5000: Convert to devm_clk_get() Shawn Guo
2013-04-25 5:05 ` [PATCH v2 1/4] ASoC: imx-sgtl5000: Do not enter the error path on success Shawn Guo
2013-04-25 10:41 ` 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=1366815286-31820-4-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=fabio.estevam@freescale.com \
--cc=kernel@pengutronix.de \
--cc=shawn.guo@linaro.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