From: Johannes Stezenbach <js@sig21.net>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org, Liam Girdwood <lrg@ti.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
alsa-devel@alsa-project.org, Daniel Mack <zonque@gmail.com>,
Sven Neumann <s.neumann@raumfeld.com>
Subject: Re: [PATCH] ASoC: sta32x: Move resource allocation and release to the corresponding callback functions
Date: Thu, 18 Aug 2011 12:14:32 +0200 [thread overview]
Message-ID: <20110818101432.GA6648@sig21.net> (raw)
In-Reply-To: <1313652664.2917.3.camel@phoenix>
On Thu, Aug 18, 2011 at 03:31:04PM +0800, Axel Lin wrote:
> This patch includes below small fixes:
>
> 1. Move sta32x_set_bias_level() from sta32x_i2c_remove() to sta32x_remove().
> 2. Remove a redundant regulator_bulk_free() call in sta32x_i2c_remove(),
> as we will call regulator_bulk_free() in sta32x_remove().
> 3. Remove unneeded snd_soc_codec_set_drvdata(codec, NULL) in sta32x_i2c_remove.
> The i2c core will set the clientdata to NULL.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> hi,
> I don't have this hardware handy. I appreciate if someone can test this patch.
>
> Axel
Your patch looks good, but I also don't have the hardware currently.
Maybe Sven or Daniel could test? But even though it's untested:
Acked-by: Johannes Stezenbach <js@sig21.net>
Thanks
Johannes
> sound/soc/codecs/sta32x.c | 13 ++-----------
> 1 files changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
> index 3d155f5..5c7def3 100644
> --- a/sound/soc/codecs/sta32x.c
> +++ b/sound/soc/codecs/sta32x.c
> @@ -812,6 +812,7 @@ static int sta32x_remove(struct snd_soc_codec *codec)
> {
> struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec);
>
> + sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF);
> regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
> regulator_bulk_free(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
>
> @@ -871,18 +872,8 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c,
> static __devexit int sta32x_i2c_remove(struct i2c_client *client)
> {
> struct sta32x_priv *sta32x = i2c_get_clientdata(client);
> - struct snd_soc_codec *codec = sta32x->codec;
> -
> - if (codec)
> - sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF);
> -
> - regulator_bulk_free(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
> -
> - if (codec) {
> - snd_soc_unregister_codec(&client->dev);
> - snd_soc_codec_set_drvdata(codec, NULL);
> - }
>
> + snd_soc_unregister_codec(&client->dev);
> kfree(sta32x);
> return 0;
> }
> --
> 1.7.4.1
>
>
>
>
next prev parent reply other threads:[~2011-08-18 10:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 7:31 [PATCH] ASoC: sta32x: Move resource allocation and release to the corresponding callback functions Axel Lin
2011-08-18 10:14 ` Johannes Stezenbach [this message]
2011-08-18 13:19 ` Liam Girdwood
2011-08-18 16:21 ` 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=20110818101432.GA6648@sig21.net \
--to=js@sig21.net \
--cc=alsa-devel@alsa-project.org \
--cc=axel.lin@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=s.neumann@raumfeld.com \
--cc=zonque@gmail.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