Skip to contentSkip to conversation

Patch "ALSA: pcm: Fix pcm_class sysfs output" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Jul 16, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ALSA: pcm: Fix pcm_class sysfs output

to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
alsa-pcm-fix-pcm_class-sysfs-output.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 60b93030b44a8c2cd015cebe5624fd7552ec67ec Mon Sep 17 00:00:00 2001

From: Takashi Iwai <[email protected]>
Date: Tue, 23 Jun 2015 11:56:22 +0200
Subject: ALSA: pcm: Fix pcm_class sysfs output

From: Takashi Iwai <[email protected]>

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')
---
 sound/core/pcm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/core/pcm.c +3 -3
@@ -1027,7 +1027,8 @@ void snd_pcm_detach_substream(struct snd
 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 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];

Patches currently in stable-queue which might be from [email protected] are

queue-4.1/alsa-hda-disable-widget-power-save-for-via-codecs.patch queue-4.1/alsa-hda-add-headset-support-to-acer-aspire-v5.patch queue-4.1/alsa-hda-set-proper-caps-for-newer-amd-hda-audio-in-kb-kv.patch queue-4.1/alsa-pcm-fix-pcm_class-sysfs-output.patch queue-4.1/alsa-hda-fix-dock-headphone-on-thinkpad-x250-seen-as-a-line-out.patch queue-4.1/alsa-hda-fix-the-dock-headphone-output-on-fujitsu-lifebook-e780.patch queue-4.1/alsa-hda-restore-the-mic-fixup-for-some-dell-machines.patch queue-4.1/alsa-hda-add-a-fixup-for-dell-e7450.patch