brcm2708: update linux 4.4 patches to latest version
[librecmc/librecmc.git] / target / linux / brcm2708 / patches-4.4 / 0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch
1 From 74f05075c9f20865651019acc76ac0cf957eebbf Mon Sep 17 00:00:00 2001
2 From: wm4 <wm4@nowhere>
3 Date: Tue, 19 Apr 2016 16:08:35 +0200
4 Subject: [PATCH 249/304] bcm2835: do not require substream for accessing chmap
5  ctl
6
7 Fixes alsasctl store/restore operation.
8 ---
9  sound/arm/bcm2835-ctl.c | 10 +---------
10  1 file changed, 1 insertion(+), 9 deletions(-)
11
12 --- a/sound/arm/bcm2835-ctl.c
13 +++ b/sound/arm/bcm2835-ctl.c
14 @@ -489,8 +489,6 @@ static int snd_bcm2835_chmap_ctl_get(str
15  {
16         struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
17         bcm2835_chip_t *chip = info->private_data;
18 -       unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
19 -       struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx);
20         struct cea_channel_speaker_allocation *ch = NULL;
21         int res = 0;
22         int cur = 0;
23 @@ -499,11 +497,6 @@ static int snd_bcm2835_chmap_ctl_get(str
24         if (mutex_lock_interruptible(&chip->audio_mutex))
25                 return -EINTR;
26  
27 -       if (!substream || !substream->runtime) {
28 -               res = -ENODEV;
29 -               goto unlock;
30 -       }
31 -
32         for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
33                 if (channel_allocations[i].ca_index == chip->cea_chmap)
34                         ch = &channel_allocations[i];
35 @@ -521,7 +514,6 @@ static int snd_bcm2835_chmap_ctl_get(str
36         while (cur < 8)
37                 ucontrol->value.integer.value[cur++] = SNDRV_CHMAP_NA;
38  
39 -unlock:
40         mutex_unlock(&chip->audio_mutex);
41         return res;
42  }
43 @@ -541,7 +533,7 @@ static int snd_bcm2835_chmap_ctl_put(str
44                 return -EINTR;
45  
46         if (!substream || !substream->runtime) {
47 -               res = -ENODEV;
48 +               /* ignore and return success for the sake of alsactl */
49                 goto unlock;
50         }
51