aboutsummaryrefslogtreecommitdiffstats
path: root/sound/aoa
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-29 11:32:26 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-02 08:42:42 -0500
commitef46c7af93f98d07cd0ed891f93a26d135785526 (patch)
tree6635fa69835d0de4fbc5e1449f70095d9d4817f0 /sound/aoa
parent7b46160000197209f7ebca8b92bdbb75795c473f (diff)
ALSA: pcm: Embed struct device
Like previous patches, at this time we embed the struct device into PCM object. However, this needs a bit more caution: struct snd_pcm doesn't own one device but two, for both playback and capture! Thus not struct snd_pcm but struct snd_pcm_str object contains the device. Along with this change, pcm->dev field is dropped for avoiding confusion. It was meant to point to a non-standard parent. But, since now we can touch each struct device directly, we can manipulate the parent field easily there, too. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/aoa')
-rw-r--r--sound/aoa/soundbus/i2sbus/pcm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/aoa/soundbus/i2sbus/pcm.c b/sound/aoa/soundbus/i2sbus/pcm.c
index 7b74a4ba75f8..a02b7b8d3532 100644
--- a/sound/aoa/soundbus/i2sbus/pcm.c
+++ b/sound/aoa/soundbus/i2sbus/pcm.c
@@ -968,7 +968,6 @@ i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,
968 printk(KERN_DEBUG "i2sbus: failed to create pcm\n"); 968 printk(KERN_DEBUG "i2sbus: failed to create pcm\n");
969 goto out_put_ci_module; 969 goto out_put_ci_module;
970 } 970 }
971 dev->pcm->dev = &dev->ofdev.dev;
972 } 971 }
973 972
974 /* ALSA yet again sucks. 973 /* ALSA yet again sucks.
@@ -988,6 +987,8 @@ i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,
988 goto out_put_ci_module; 987 goto out_put_ci_module;
989 snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_PLAYBACK, 988 snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_PLAYBACK,
990 &i2sbus_playback_ops); 989 &i2sbus_playback_ops);
990 dev->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].dev.parent =
991 &dev->ofdev.dev;
991 i2sdev->out.created = 1; 992 i2sdev->out.created = 1;
992 } 993 }
993 994
@@ -1003,6 +1004,8 @@ i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,
1003 goto out_put_ci_module; 1004 goto out_put_ci_module;
1004 snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_CAPTURE, 1005 snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_CAPTURE,
1005 &i2sbus_record_ops); 1006 &i2sbus_record_ops);
1007 dev->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].dev.parent =
1008 &dev->ofdev.dev;
1006 i2sdev->in.created = 1; 1009 i2sdev->in.created = 1;
1007 } 1010 }
1008 1011