Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1187859

[PATCH 4.1 15/65] ALSA: pcm: Fix pcm_class sysfs output

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.1 15/65] ALSA: pcm: Fix pcm_class sysfs output
Date Sun, 19 Jul 2015 21:50:01 +0200
Message-ID <pO2KZ-3Yv-1@gated-at.bofh.it> (permalink)
References <pO28i-3ee-9@gated-at.bofh.it>
X-Original-To linux-kernel@vger.kernel.org
X-Mailer git-send-email 2.4.6
User-Agent quilt/0.64
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 49
Organization linux.* mail to news gateway
X-Original-Cc Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Takashi Iwai <tiwai@suse.de>
X-Original-Date Sun, 19 Jul 2015 12:07:34 -0700
X-Original-Message-ID <20150719190810.004071807@linuxfoundation.org>
X-Original-References <20150719190809.469715936@linuxfoundation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1187859

Show key headers only | View raw


4.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

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>

---
 sound/core/pcm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -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];


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.1 00/65] 4.1.3-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:40 +0200
  [PATCH 4.1 43/65] regmap: Fix possible shift overflow in regmap_field_init() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:40 +0200
  [PATCH 4.1 22/65] ALSA: hda - Add a fixup for Dell E7450 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:40 +0200
  [PATCH 4.1 39/65] mm: kmemleak: allow safe memory scanning during kmemleak disabling Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:40 +0200
  [PATCH 4.1 04/65] kernfs: Add support for always empty directories. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:40 +0200
  [PATCH 4.1 15/65] ALSA: pcm: Fix pcm_class sysfs output Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 16/65] ALSA: hda - Fix Dock Headphone on Thinkpad X250 seen as a Line Out Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 17/65] ALSA: hda - set proper caps for newer AMD hda audio in KB/KV Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 13/65] ipr: Increase default adapter init stage change timeout Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 11/65] gpio: rcar: Check for irq_set_irq_wake() failures Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 14/65] Disable write buffering on Toshiba ToPIC95 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 12/65] rcu: Correctly handle non-empty Tiny RCU callback list with none ready Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 18/65] ALSA: hda - Disable widget power-save for VIA codecs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  [PATCH 4.1 10/65] gpio: crystalcove: set IRQCHIP_SKIP_SET_WAKE for the irqchip Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:50 +0200
  Re: [PATCH 4.1 00/65] 4.1.3-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-07-20 19:20 +0200

csiph-web