Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933381AbbGST06 (ORCPT ); Sun, 19 Jul 2015 15:26:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38674 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932643AbbGSTLj (ORCPT ); Sun, 19 Jul 2015 15:11:39 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.0 14/58] ALSA: pcm: Fix pcm_class sysfs output Date: Sun, 19 Jul 2015 12:10:52 -0700 Message-Id: <20150719190811.817044059@linuxfoundation.org> X-Mailer: git-send-email 2.4.6 In-Reply-To: <20150719190811.308546345@linuxfoundation.org> References: <20150719190811.308546345@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1642 Lines: 49 4.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai 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 Signed-off-by: Greg Kroah-Hartman --- sound/core/pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -1044,7 +1044,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", @@ -1053,8 +1054,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/