* [PATCH] soc-core: move setting ac97 platform data earlier than ac97 read/write
@ 2009-11-11 9:41 Barry Song
2009-11-11 11:28 ` Mark Brown
2009-11-11 11:33 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Barry Song @ 2009-11-11 9:41 UTC (permalink / raw)
To: broonie; +Cc: uclinux-dist-devel, alsa-devel, Barry Song, Marek Vasut
While probing, AC97 codec drivers generically execute the following sequence:
snd_soc_new_ac97_codec -> snd_soc_new_pcms -> reset ac-link/read AC97 ID to
detect ->... -> snd_soc_init_card
commit 474828a40f6ddab6e2a3475a19c5c84aa3ec7d60 adds platform_data to
snd_ac97 instance. But ac97 platform data hasn't given to snd_ac97 until
snd_soc_init_card. Then while ac97_read access platform_data of snd_ac97
for detecting, NULL pointer oops will fire. That means old platform_data
patch doesn't work in real-life cases.
This patch moves the operation of setting ac97 platform_data earlier
than ac97 reading/writing operations. Then it makes platform_data of
AC97 become practically useful.
Signed-off-by: Barry Song <21cnbao@gmail.com>
cc: Marek Vasut <marek.vasut@gmail.com>
---
sound/soc/soc-core.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2d190df..a900778 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1427,6 +1427,9 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
mutex_unlock(&codec->mutex);
return ret;
}
+ if (card->dai_link[i].codec_dai->ac97_control)
+ snd_ac97_dev_add_pdata(codec->ac97,
+ card->dai_link[i].cpu_dai->ac97_pdata);
}
mutex_unlock(&codec->mutex);
@@ -1458,11 +1461,8 @@ int snd_soc_init_card(struct snd_soc_device *socdev)
continue;
}
}
- if (card->dai_link[i].codec_dai->ac97_control) {
+ if (card->dai_link[i].codec_dai->ac97_control)
ac97 = 1;
- snd_ac97_dev_add_pdata(codec->ac97,
- card->dai_link[i].cpu_dai->ac97_pdata);
- }
}
snprintf(codec->card->shortname, sizeof(codec->card->shortname),
"%s", card->name);
--
1.5.6.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] soc-core: move setting ac97 platform data earlier than ac97 read/write
2009-11-11 9:41 [PATCH] soc-core: move setting ac97 platform data earlier than ac97 read/write Barry Song
@ 2009-11-11 11:28 ` Mark Brown
2009-11-11 11:33 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-11-11 11:28 UTC (permalink / raw)
To: Barry Song; +Cc: uclinux-dist-devel, alsa-devel, Marek Vasut
On Wed, Nov 11, 2009 at 05:41:15PM +0800, Barry Song wrote:
> While probing, AC97 codec drivers generically execute the following sequence:
> snd_soc_new_ac97_codec -> snd_soc_new_pcms -> reset ac-link/read AC97 ID to
> detect ->... -> snd_soc_init_card
>
> commit 474828a40f6ddab6e2a3475a19c5c84aa3ec7d60 adds platform_data to
> snd_ac97 instance. But ac97 platform data hasn't given to snd_ac97 until
> snd_soc_init_card. Then while ac97_read access platform_data of snd_ac97
> for detecting, NULL pointer oops will fire. That means old platform_data
> patch doesn't work in real-life cases.
>
> This patch moves the operation of setting ac97 platform_data earlier
> than ac97 reading/writing operations. Then it makes platform_data of
> AC97 become practically useful.
>
> Signed-off-by: Barry Song <21cnbao@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] soc-core: move setting ac97 platform data earlier than ac97 read/write
2009-11-11 9:41 [PATCH] soc-core: move setting ac97 platform data earlier than ac97 read/write Barry Song
2009-11-11 11:28 ` Mark Brown
@ 2009-11-11 11:33 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-11-11 11:33 UTC (permalink / raw)
To: Barry Song; +Cc: uclinux-dist-devel, alsa-devel, Marek Vasut
On Wed, Nov 11, 2009 at 05:41:15PM +0800, Barry Song wrote:
> While probing, AC97 codec drivers generically execute the following sequence:
> snd_soc_new_ac97_codec -> snd_soc_new_pcms -> reset ac-link/read AC97 ID to
> detect ->... -> snd_soc_init_card
Actually, could you please regenerate this against current ASoC, it
doesn't apply.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-11 11:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11 9:41 [PATCH] soc-core: move setting ac97 platform data earlier than ac97 read/write Barry Song
2009-11-11 11:28 ` Mark Brown
2009-11-11 11:33 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.