diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-11-20 08:03:48 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:29:14 -0500 |
commit | 2af677fc884fc6dc79e65c99050ea607ac8bab9b (patch) | |
tree | 4291d36c2f116d5887b88da5f0213b68933a1201 /sound/core/pcm.c | |
parent | a106cd3d9e88c8761bd0eac2ce402cc82bd11fea (diff) |
[ALSA] dynamic minors (1/6): store device type in struct snd_minor
Instead of a comment string, store the device type in the snd_minor
structure. This makes snd_minor more flexible, and has the nice side
effect that we don't need anymore to create a separate snd_minor
template for registering a device but can pass the file_operations
directly to snd_register_device().
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/core/pcm.c')
-rw-r--r-- | sound/core/pcm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 9305ac357a3e..2bc5f69ec2a8 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -597,7 +597,6 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) | |||
597 | pstr->stream = stream; | 597 | pstr->stream = stream; |
598 | pstr->pcm = pcm; | 598 | pstr->pcm = pcm; |
599 | pstr->substream_count = substream_count; | 599 | pstr->substream_count = substream_count; |
600 | pstr->reg = &snd_pcm_reg[stream]; | ||
601 | if (substream_count > 0) { | 600 | if (substream_count > 0) { |
602 | err = snd_pcm_stream_proc_init(pstr); | 601 | err = snd_pcm_stream_proc_init(pstr); |
603 | if (err < 0) { | 602 | if (err < 0) { |
@@ -897,7 +896,10 @@ static int snd_pcm_dev_register(struct snd_device *device) | |||
897 | devtype = SNDRV_DEVICE_TYPE_PCM_CAPTURE; | 896 | devtype = SNDRV_DEVICE_TYPE_PCM_CAPTURE; |
898 | break; | 897 | break; |
899 | } | 898 | } |
900 | if ((err = snd_register_device(devtype, pcm->card, pcm->device, pcm->streams[cidx].reg, str)) < 0) { | 899 | if ((err = snd_register_device(devtype, pcm->card, |
900 | pcm->device, | ||
901 | &snd_pcm_f_ops[cidx], str)) < 0) | ||
902 | { | ||
901 | snd_pcm_devices[idx] = NULL; | 903 | snd_pcm_devices[idx] = NULL; |
902 | up(®ister_mutex); | 904 | up(®ister_mutex); |
903 | return err; | 905 | return err; |