From: Liam Girdwood <lrg@ti.com>
To: "Girdwood, Liam" <lrg@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] ASoC: core - fix module reference counting for CPU DAIs
Date: Tue, 24 May 2011 13:58:54 +0100 [thread overview]
Message-ID: <4DDBAB8E.4060809@ti.com> (raw)
In-Reply-To: <1306241863-3985-1-git-send-email-lrg@ti.com>
On 24/05/11 13:57, Girdwood, Liam wrote:
> Currently CODEC and platform drivers have their module reference count
> incremented soc_probe_dai_link() whilst CPU DAI drivers have their reference
> count incremented in soc_bind_dai_link().
>
> CPU DAIs should have their reference count incremented in soc_probe_dai_link()
> just like the CODEC and platform drivers.
>
> Signed-off-by: Liam Girdwood <lrg@ti.com>
> ---
> sound/soc/soc-core.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 5968745..f051e85 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1306,10 +1306,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
> /* no, then find CPU DAI from registered DAIs*/
> list_for_each_entry(cpu_dai, &dai_list, list) {
> if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) {
> -
> - if (!try_module_get(cpu_dai->dev->driver->owner))
> - return -ENODEV;
> -
> rtd->cpu_dai = cpu_dai;
> goto find_codec;
> }
> @@ -1621,12 +1617,17 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
> rtd->pmdown_time = pmdown_time;
>
> /* probe the cpu_dai */
> +
gah - without the newline.
> if (!cpu_dai->probed) {
> + if (!try_module_get(cpu_dai->dev->driver->owner))
> + return -ENODEV;
> +
> if (cpu_dai->driver->probe) {
> ret = cpu_dai->driver->probe(cpu_dai);
> if (ret < 0) {
> printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n",
> cpu_dai->name);
> + module_put(cpu_dai->dev->driver->owner);
> return ret;
> }
> }
next prev parent reply other threads:[~2011-05-24 12:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 12:57 [PATCH] ASoC: core - fix module reference counting for CPU DAIs Liam Girdwood
2011-05-24 12:58 ` Liam Girdwood [this message]
2011-05-24 15:25 ` 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=4DDBAB8E.4060809@ti.com \
--to=lrg@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.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).