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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
This commit is contained in:
Takashi Iwai 2015-01-29 17:32:26 +01:00
commit ef46c7af93
5 changed files with 22 additions and 27 deletions

View file

@ -449,6 +449,7 @@ struct snd_pcm_str {
#endif
#endif
struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */
struct device dev;
};
struct snd_pcm {
@ -465,7 +466,6 @@ struct snd_pcm {
wait_queue_head_t open_wait;
void *private_data;
void (*private_free) (struct snd_pcm *pcm);
struct device *dev; /* actual hw device this belongs to */
bool internal; /* pcm is for internal use only */
bool nonatomic; /* whole PCM operations are in non-atomic context */
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)