merge of '0b604857bbf871639fdb43ee8380222e8ef64bb7'
[vuplus_openembedded] / packages / linux / linux-rp-2.6.24 / tosa / 0038-Don-t-lock-the-codec-list-in-snd_soc_dapm_new_widget.patch
1 From 5bae1fab16c7b14a458aa90e5654fe3a1d8d960f Mon Sep 17 00:00:00 2001
2 From: Mark Brown <broonie@opensource.wolfsonmicro.com>
3 Date: Sun, 20 Jan 2008 00:06:06 +0300
4 Subject: [PATCH 38/64] Don't lock the codec list in snd_soc_dapm_new_widgets()
5
6 On Wed, Jan 16, 2008 at 02:40:55AM +0300, Dmitry wrote:
7
8 > I'm sorry, but I tested this patch only now. And I just got another
9 > message from lockdep:
10
11 Could you give this patch a try, please?
12 ---
13  sound/soc/soc-core.c |    7 +++++--
14  1 files changed, 5 insertions(+), 2 deletions(-)
15
16 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
17 index e6a67b5..7f3ed9f 100644
18 --- a/sound/soc/soc-core.c
19 +++ b/sound/soc/soc-core.c
20 @@ -1090,7 +1090,6 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
21         struct snd_soc_machine *machine = socdev->machine;
22         int ret = 0, i, ac97 = 0, err = 0;
23  
24 -       mutex_lock(&codec->mutex);
25         for(i = 0; i < machine->num_links; i++) {
26                 if (socdev->machine->dai_link[i].init) {
27                         err = socdev->machine->dai_link[i].init(codec);
28 @@ -1116,12 +1115,14 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
29                 goto out;
30         }
31  
32 +       mutex_lock(&codec->mutex);
33  #ifdef CONFIG_SND_SOC_AC97_BUS
34         if (ac97) {
35                 ret = soc_ac97_dev_register(codec);
36                 if (ret < 0) {
37                         printk(KERN_ERR "asoc: AC97 device register failed\n");
38                         snd_card_free(codec->card);
39 +                       mutex_unlock(&codec->mutex);
40                         goto out;
41                 }
42         }
43 @@ -1134,8 +1135,10 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
44         err = device_create_file(socdev->dev, &dev_attr_codec_reg);
45         if (err < 0)
46                 printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n");
47 -out:
48 +
49         mutex_unlock(&codec->mutex);
50 +
51 +out:
52         return ret;
53  }
54  EXPORT_SYMBOL_GPL(snd_soc_register_card);
55 -- 
56 1.5.3.8
57