ALSA: hda - restore the MIC FIXUP for some Dell machines
[firefly-linux-kernel-4.4.55.git] / sound / core / pcm.c
index e53794319ef3403f00021d1017f2a92a7c49fd18..02bd96954dc42c05266ef9d04a3d77918cf9cf6c 100644 (file)
@@ -1027,7 +1027,8 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
 static ssize_t show_pcm_class(struct device *dev,
                              struct device_attribute *attr, char *buf)
 {
-       struct snd_pcm *pcm;
+       struct snd_pcm_str *pstr = container_of(dev, struct snd_pcm_str, dev);
+       struct snd_pcm *pcm = pstr->pcm;
        const char *str;
        static const char *strs[SNDRV_PCM_CLASS_LAST + 1] = {
                [SNDRV_PCM_CLASS_GENERIC] = "generic",
@@ -1036,8 +1037,7 @@ static ssize_t show_pcm_class(struct device *dev,
                [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer",
        };
 
-       if (! (pcm = dev_get_drvdata(dev)) ||
-           pcm->dev_class > SNDRV_PCM_CLASS_LAST)
+       if (pcm->dev_class > SNDRV_PCM_CLASS_LAST)
                str = "none";
        else
                str = strs[pcm->dev_class];