summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-07 02:12:45 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-10 23:53:56 +0100
commit36ae1a96c4dcb0f6581d595cc5d43cf3a7e648c7 (patch)
treef0de43670060374bf9f2e81a4c2fcb65dc821545 /sound/soc/soc-dapm.c
parentASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC (diff)
downloadlinux-36ae1a96c4dcb0f6581d595cc5d43cf3a7e648c7.tar.xz
linux-36ae1a96c4dcb0f6581d595cc5d43cf3a7e648c7.zip
ASoC: Dynamically allocate the rtd device for a non-empty release()
The device model needs a release() function so it can free devices when they become dereferenced. Do that for rtds. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index e174d0811dae..3ad1f59b8028 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1738,8 +1738,7 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
static ssize_t dapm_widget_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct snd_soc_pcm_runtime *rtd =
- container_of(dev, struct snd_soc_pcm_runtime, dev);
+ struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev);
struct snd_soc_codec *codec =rtd->codec;
struct snd_soc_dapm_widget *w;
int count = 0;