From 2af677fc884fc6dc79e65c99050ea607ac8bab9b Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Sun, 20 Nov 2005 14:03:48 +0100 Subject: [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 --- sound/core/pcm_native.c | 53 ++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 32 deletions(-) (limited to 'sound/core/pcm_native.c') diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 7bac1cbe38d..bb40c016135 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -3370,40 +3370,29 @@ out: * Register section */ -static struct file_operations snd_pcm_f_ops_playback = { - .owner = THIS_MODULE, - .write = snd_pcm_write, - .writev = snd_pcm_writev, - .open = snd_pcm_open, - .release = snd_pcm_release, - .poll = snd_pcm_playback_poll, - .unlocked_ioctl = snd_pcm_playback_ioctl, - .compat_ioctl = snd_pcm_ioctl_compat, - .mmap = snd_pcm_mmap, - .fasync = snd_pcm_fasync, -}; - -static struct file_operations snd_pcm_f_ops_capture = { - .owner = THIS_MODULE, - .read = snd_pcm_read, - .readv = snd_pcm_readv, - .open = snd_pcm_open, - .release = snd_pcm_release, - .poll = snd_pcm_capture_poll, - .unlocked_ioctl = snd_pcm_capture_ioctl, - .compat_ioctl = snd_pcm_ioctl_compat, - .mmap = snd_pcm_mmap, - .fasync = snd_pcm_fasync, -}; - -struct snd_minor snd_pcm_reg[2] = -{ +struct file_operations snd_pcm_f_ops[2] = { { - .comment = "digital audio playback", - .f_ops = &snd_pcm_f_ops_playback, + .owner = THIS_MODULE, + .write = snd_pcm_write, + .writev = snd_pcm_writev, + .open = snd_pcm_open, + .release = snd_pcm_release, + .poll = snd_pcm_playback_poll, + .unlocked_ioctl = snd_pcm_playback_ioctl, + .compat_ioctl = snd_pcm_ioctl_compat, + .mmap = snd_pcm_mmap, + .fasync = snd_pcm_fasync, }, { - .comment = "digital audio capture", - .f_ops = &snd_pcm_f_ops_capture, + .owner = THIS_MODULE, + .read = snd_pcm_read, + .readv = snd_pcm_readv, + .open = snd_pcm_open, + .release = snd_pcm_release, + .poll = snd_pcm_capture_poll, + .unlocked_ioctl = snd_pcm_capture_ioctl, + .compat_ioctl = snd_pcm_ioctl_compat, + .mmap = snd_pcm_mmap, + .fasync = snd_pcm_fasync, } }; -- cgit v1.2.3