]> Pileus Git - ~andy/linux/blobdiff - sound/core/control.c
Merge branches 'topic/fix/misc' and 'topic/fix/hda' into for-linus
[~andy/linux] / sound / core / control.c
index 3c5e746d619b76572327ea3b0a4fba849e1c6ed6..b0bf42691047307adc597b3c11a2a1c583f56e14 100644 (file)
@@ -225,8 +225,13 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol,
        kctl.id.iface = ncontrol->iface;
        kctl.id.device = ncontrol->device;
        kctl.id.subdevice = ncontrol->subdevice;
-       if (ncontrol->name)
+       if (ncontrol->name) {
                strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name));
+               if (strcmp(ncontrol->name, kctl.id.name) != 0)
+                       snd_printk(KERN_WARNING
+                                  "Control name '%s' truncated to '%s'\n",
+                                  ncontrol->name, kctl.id.name);
+       }
        kctl.id.index = ncontrol->index;
        kctl.count = ncontrol->count ? ncontrol->count : 1;
        access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
@@ -1438,12 +1443,12 @@ static int snd_ctl_dev_disconnect(struct snd_device *device)
        if (snd_BUG_ON(cardnum < 0 || cardnum >= SNDRV_CARDS))
                return -ENXIO;
 
-       down_read(&card->controls_rwsem);
+       read_lock(&card->ctl_files_rwlock);
        list_for_each_entry(ctl, &card->ctl_files, list) {
                wake_up(&ctl->change_sleep);
                kill_fasync(&ctl->fasync, SIGIO, POLL_ERR);
        }
-       up_read(&card->controls_rwsem);
+       read_unlock(&card->ctl_files_rwlock);
 
        if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL,
                                         card, -1)) < 0)