diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-06-23 05:56:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-21 13:10:01 -0400 |
commit | 08e394684b82b0987295d96201071f52504c83f5 (patch) | |
tree | e332e4c102dd80a081a4bee608fc06d169d3aa44 /sound | |
parent | 37100f76f93236e99a89c0f0c5531eff03920725 (diff) |
ALSA: pcm: Fix pcm_class sysfs output
commit 60b93030b44a8c2cd015cebe5624fd7552ec67ec upstream.
The pcm_class sysfs of each PCM substream gives only "none" since the
recent code change to embed the struct device. Fix the code to point
directly to the embedded device object properly.
Fixes: ef46c7af93f9 ('ALSA: pcm: Embed struct device')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index b25bcf5b8644..dfed728d8c87 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -1027,7 +1027,8 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream) | |||
1027 | static ssize_t show_pcm_class(struct device *dev, | 1027 | static ssize_t show_pcm_class(struct device *dev, |
1028 | struct device_attribute *attr, char *buf) | 1028 | struct device_attribute *attr, char *buf) |
1029 | { | 1029 | { |
1030 | struct snd_pcm *pcm; | 1030 | struct snd_pcm_str *pstr = container_of(dev, struct snd_pcm_str, dev); |
1031 | struct snd_pcm *pcm = pstr->pcm; | ||
1031 | const char *str; | 1032 | const char *str; |
1032 | static const char *strs[SNDRV_PCM_CLASS_LAST + 1] = { | 1033 | static const char *strs[SNDRV_PCM_CLASS_LAST + 1] = { |
1033 | [SNDRV_PCM_CLASS_GENERIC] = "generic", | 1034 | [SNDRV_PCM_CLASS_GENERIC] = "generic", |
@@ -1036,8 +1037,7 @@ static ssize_t show_pcm_class(struct device *dev, | |||
1036 | [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer", | 1037 | [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer", |
1037 | }; | 1038 | }; |
1038 | 1039 | ||
1039 | if (! (pcm = dev_get_drvdata(dev)) || | 1040 | if (pcm->dev_class > SNDRV_PCM_CLASS_LAST) |
1040 | pcm->dev_class > SNDRV_PCM_CLASS_LAST) | ||
1041 | str = "none"; | 1041 | str = "none"; |
1042 | else | 1042 | else |
1043 | str = strs[pcm->dev_class]; | 1043 | str = strs[pcm->dev_class]; |