aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/oss/dmasound/dmasound_core.c20
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 =
1346 .ioctl = sq_ioctl, 1346 .ioctl = sq_ioctl,
1347 .open = sq_open, 1347 .open = sq_open,
1348 .release = sq_release, 1348 .release = sq_release,
1349};
1350
1349#ifdef HAS_RECORD 1351#ifdef HAS_RECORD
1350 .read = NULL /* default to no read for compat mode */ 1352static const struct file_operations sq_fops_record =
1351#endif 1353{
1354 .owner = THIS_MODULE,
1355 .llseek = no_llseek,
1356 .write = sq_write,
1357 .poll = sq_poll,
1358 .ioctl = sq_ioctl,
1359 .open = sq_open,
1360 .release = sq_release,
1361 .read = sq_read,
1352}; 1362};
1363#endif
1353 1364
1354static int sq_init(void) 1365static int sq_init(void)
1355{ 1366{
1367 const struct file_operations *fops = &sq_fops;
1356#ifndef MODULE 1368#ifndef MODULE
1357 int sq_unit; 1369 int sq_unit;
1358#endif 1370#endif
1359 1371
1360#ifdef HAS_RECORD 1372#ifdef HAS_RECORD
1361 if (dmasound.mach.record) 1373 if (dmasound.mach.record)
1362 sq_fops.read = sq_read ; 1374 fops = &sq_fops_record;
1363#endif 1375#endif
1364 sq_unit = register_sound_dsp(&sq_fops, -1); 1376 sq_unit = register_sound_dsp(fops, -1);
1365 if (sq_unit < 0) { 1377 if (sq_unit < 0) {
1366 printk(KERN_ERR "dmasound_core: couldn't register fops\n") ; 1378 printk(KERN_ERR "dmasound_core: couldn't register fops\n") ;
1367 return sq_unit ; 1379 return sq_unit ;