| .. | .. |
|---|
| 206 | 206 | |
|---|
| 207 | 207 | MODULE_LICENSE("GPL"); |
|---|
| 208 | 208 | |
|---|
| 209 | | -#ifdef MODULE |
|---|
| 210 | 209 | static int sq_unit = -1; |
|---|
| 211 | 210 | static int mixer_unit = -1; |
|---|
| 212 | 211 | static int state_unit = -1; |
|---|
| 213 | 212 | static int irq_installed; |
|---|
| 214 | | -#endif /* MODULE */ |
|---|
| 215 | 213 | |
|---|
| 216 | 214 | /* control over who can modify resources shared between play/record */ |
|---|
| 217 | 215 | static fmode_t shared_resource_owner; |
|---|
| .. | .. |
|---|
| 384 | 382 | .owner = THIS_MODULE, |
|---|
| 385 | 383 | .llseek = no_llseek, |
|---|
| 386 | 384 | .unlocked_ioctl = mixer_unlocked_ioctl, |
|---|
| 385 | + .compat_ioctl = compat_ptr_ioctl, |
|---|
| 387 | 386 | .open = mixer_open, |
|---|
| 388 | 387 | .release = mixer_release, |
|---|
| 389 | 388 | }; |
|---|
| 390 | 389 | |
|---|
| 391 | 390 | static void mixer_init(void) |
|---|
| 392 | 391 | { |
|---|
| 393 | | -#ifndef MODULE |
|---|
| 394 | | - int mixer_unit; |
|---|
| 395 | | -#endif |
|---|
| 396 | 392 | mixer_unit = register_sound_mixer(&mixer_fops, -1); |
|---|
| 397 | 393 | if (mixer_unit < 0) |
|---|
| 398 | 394 | return; |
|---|
| .. | .. |
|---|
| 1167 | 1163 | .write = sq_write, |
|---|
| 1168 | 1164 | .poll = sq_poll, |
|---|
| 1169 | 1165 | .unlocked_ioctl = sq_unlocked_ioctl, |
|---|
| 1166 | + .compat_ioctl = compat_ptr_ioctl, |
|---|
| 1170 | 1167 | .open = sq_open, |
|---|
| 1171 | 1168 | .release = sq_release, |
|---|
| 1172 | 1169 | }; |
|---|
| .. | .. |
|---|
| 1174 | 1171 | static int sq_init(void) |
|---|
| 1175 | 1172 | { |
|---|
| 1176 | 1173 | const struct file_operations *fops = &sq_fops; |
|---|
| 1177 | | -#ifndef MODULE |
|---|
| 1178 | | - int sq_unit; |
|---|
| 1179 | | -#endif |
|---|
| 1180 | 1174 | |
|---|
| 1181 | 1175 | sq_unit = register_sound_dsp(fops, -1); |
|---|
| 1182 | 1176 | if (sq_unit < 0) { |
|---|
| .. | .. |
|---|
| 1378 | 1372 | |
|---|
| 1379 | 1373 | static int state_init(void) |
|---|
| 1380 | 1374 | { |
|---|
| 1381 | | -#ifndef MODULE |
|---|
| 1382 | | - int state_unit; |
|---|
| 1383 | | -#endif |
|---|
| 1384 | 1375 | state_unit = register_sound_special(&state_fops, SND_DEV_STATUS); |
|---|
| 1385 | 1376 | if (state_unit < 0) |
|---|
| 1386 | 1377 | return state_unit ; |
|---|
| .. | .. |
|---|
| 1398 | 1389 | int dmasound_init(void) |
|---|
| 1399 | 1390 | { |
|---|
| 1400 | 1391 | int res ; |
|---|
| 1401 | | -#ifdef MODULE |
|---|
| 1392 | + |
|---|
| 1402 | 1393 | if (irq_installed) |
|---|
| 1403 | 1394 | return -EBUSY; |
|---|
| 1404 | | -#endif |
|---|
| 1405 | 1395 | |
|---|
| 1406 | 1396 | /* Set up sound queue, /dev/audio and /dev/dsp. */ |
|---|
| 1407 | 1397 | |
|---|
| .. | .. |
|---|
| 1420 | 1410 | printk(KERN_ERR "DMA sound driver: Interrupt initialization failed\n"); |
|---|
| 1421 | 1411 | return -ENODEV; |
|---|
| 1422 | 1412 | } |
|---|
| 1423 | | -#ifdef MODULE |
|---|
| 1424 | 1413 | irq_installed = 1; |
|---|
| 1425 | | -#endif |
|---|
| 1426 | 1414 | |
|---|
| 1427 | 1415 | printk(KERN_INFO "%s DMA sound driver rev %03d installed\n", |
|---|
| 1428 | 1416 | dmasound.mach.name, (DMASOUND_CORE_REVISION<<4) + |
|---|
| .. | .. |
|---|
| 1435 | 1423 | numWriteBufs, writeBufSize) ; |
|---|
| 1436 | 1424 | return 0; |
|---|
| 1437 | 1425 | } |
|---|
| 1438 | | - |
|---|
| 1439 | | -#ifdef MODULE |
|---|
| 1440 | 1426 | |
|---|
| 1441 | 1427 | void dmasound_deinit(void) |
|---|
| 1442 | 1428 | { |
|---|
| .. | .. |
|---|
| 1456 | 1442 | unregister_sound_dsp(sq_unit); |
|---|
| 1457 | 1443 | } |
|---|
| 1458 | 1444 | |
|---|
| 1459 | | -#else /* !MODULE */ |
|---|
| 1460 | | - |
|---|
| 1461 | | -static int dmasound_setup(char *str) |
|---|
| 1445 | +static int __maybe_unused dmasound_setup(char *str) |
|---|
| 1462 | 1446 | { |
|---|
| 1463 | 1447 | int ints[6], size; |
|---|
| 1464 | 1448 | |
|---|
| .. | .. |
|---|
| 1476 | 1460 | printk("dmasound_setup: invalid catch radius, using default = %d\n", catchRadius); |
|---|
| 1477 | 1461 | else |
|---|
| 1478 | 1462 | catchRadius = ints[3]; |
|---|
| 1479 | | - /* fall through */ |
|---|
| 1463 | + fallthrough; |
|---|
| 1480 | 1464 | case 2: |
|---|
| 1481 | 1465 | if (ints[1] < MIN_BUFFERS) |
|---|
| 1482 | 1466 | printk("dmasound_setup: invalid number of buffers, using default = %d\n", numWriteBufs); |
|---|
| 1483 | 1467 | else |
|---|
| 1484 | 1468 | numWriteBufs = ints[1]; |
|---|
| 1485 | | - /* fall through */ |
|---|
| 1469 | + fallthrough; |
|---|
| 1486 | 1470 | case 1: |
|---|
| 1487 | 1471 | if ((size = ints[2]) < 256) /* check for small buffer specs */ |
|---|
| 1488 | 1472 | size <<= 10 ; |
|---|
| .. | .. |
|---|
| 1500 | 1484 | } |
|---|
| 1501 | 1485 | |
|---|
| 1502 | 1486 | __setup("dmasound=", dmasound_setup); |
|---|
| 1503 | | - |
|---|
| 1504 | | -#endif /* !MODULE */ |
|---|
| 1505 | 1487 | |
|---|
| 1506 | 1488 | /* |
|---|
| 1507 | 1489 | * Conversion tables |
|---|
| .. | .. |
|---|
| 1589 | 1571 | |
|---|
| 1590 | 1572 | EXPORT_SYMBOL(dmasound); |
|---|
| 1591 | 1573 | EXPORT_SYMBOL(dmasound_init); |
|---|
| 1592 | | -#ifdef MODULE |
|---|
| 1593 | 1574 | EXPORT_SYMBOL(dmasound_deinit); |
|---|
| 1594 | | -#endif |
|---|
| 1595 | 1575 | EXPORT_SYMBOL(dmasound_write_sq); |
|---|
| 1596 | 1576 | EXPORT_SYMBOL(dmasound_catchRadius); |
|---|
| 1597 | 1577 | #ifdef HAS_8BIT_TABLES |
|---|