diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-03-14 09:04:31 +0000 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-14 15:27:48 -0700 |
commit | d8b3966e4c976dbf5f2fbe693b381305f7911e3d (patch) | |
tree | 7a9358f3c19da016760cac6f704a546aac4bf2cf /sound | |
parent | abf0437b420b1476b9afd56af69d1a725f51359c (diff) | |
download | linux-stable-d8b3966e4c976dbf5f2fbe693b381305f7911e3d.tar.gz linux-stable-d8b3966e4c976dbf5f2fbe693b381305f7911e3d.tar.bz2 linux-stable-d8b3966e4c976dbf5f2fbe693b381305f7911e3d.zip |
[PATCH] const file_operations fallout
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/oss/dmasound/dmasound_core.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c index a0ec886f2aa3..f4056a9c371b 100644 --- a/sound/oss/dmasound/dmasound_core.c +++ b/sound/oss/dmasound/dmasound_core.c @@ -1346,22 +1346,34 @@ static const struct file_operations sq_fops = .ioctl = sq_ioctl, .open = sq_open, .release = sq_release, +}; + #ifdef HAS_RECORD - .read = NULL /* default to no read for compat mode */ -#endif +static const struct file_operations sq_fops_record = +{ + .owner = THIS_MODULE, + .llseek = no_llseek, + .write = sq_write, + .poll = sq_poll, + .ioctl = sq_ioctl, + .open = sq_open, + .release = sq_release, + .read = sq_read, }; +#endif static int sq_init(void) { + const struct file_operations *fops = &sq_fops; #ifndef MODULE int sq_unit; #endif #ifdef HAS_RECORD if (dmasound.mach.record) - sq_fops.read = sq_read ; + fops = &sq_fops_record; #endif - sq_unit = register_sound_dsp(&sq_fops, -1); + sq_unit = register_sound_dsp(fops, -1); if (sq_unit < 0) { printk(KERN_ERR "dmasound_core: couldn't register fops\n") ; return sq_unit ; |