diff options
Diffstat (limited to 'sound/oss/swarm_cs4297a.c')
-rw-r--r-- | sound/oss/swarm_cs4297a.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c index 3136c88eacdf..b15840ad2527 100644 --- a/sound/oss/swarm_cs4297a.c +++ b/sound/oss/swarm_cs4297a.c | |||
@@ -68,6 +68,7 @@ | |||
68 | #include <linux/delay.h> | 68 | #include <linux/delay.h> |
69 | #include <linux/sound.h> | 69 | #include <linux/sound.h> |
70 | #include <linux/slab.h> | 70 | #include <linux/slab.h> |
71 | #include <linux/smp_lock.h> | ||
71 | #include <linux/soundcard.h> | 72 | #include <linux/soundcard.h> |
72 | #include <linux/ac97_codec.h> | 73 | #include <linux/ac97_codec.h> |
73 | #include <linux/pci.h> | 74 | #include <linux/pci.h> |
@@ -1534,6 +1535,7 @@ static int cs4297a_open_mixdev(struct inode *inode, struct file *file) | |||
1534 | CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, | 1535 | CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, |
1535 | printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()+\n")); | 1536 | printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()+\n")); |
1536 | 1537 | ||
1538 | lock_kernel(); | ||
1537 | list_for_each(entry, &cs4297a_devs) | 1539 | list_for_each(entry, &cs4297a_devs) |
1538 | { | 1540 | { |
1539 | s = list_entry(entry, struct cs4297a_state, list); | 1541 | s = list_entry(entry, struct cs4297a_state, list); |
@@ -1544,6 +1546,8 @@ static int cs4297a_open_mixdev(struct inode *inode, struct file *file) | |||
1544 | { | 1546 | { |
1545 | CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2, | 1547 | CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2, |
1546 | printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- -ENODEV\n")); | 1548 | printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- -ENODEV\n")); |
1549 | |||
1550 | unlock_kernel(); | ||
1547 | return -ENODEV; | 1551 | return -ENODEV; |
1548 | } | 1552 | } |
1549 | VALIDATE_STATE(s); | 1553 | VALIDATE_STATE(s); |
@@ -1551,6 +1555,7 @@ static int cs4297a_open_mixdev(struct inode *inode, struct file *file) | |||
1551 | 1555 | ||
1552 | CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, | 1556 | CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, |
1553 | printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n")); | 1557 | printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n")); |
1558 | unlock_kernel(); | ||
1554 | 1559 | ||
1555 | return nonseekable_open(inode, file); | 1560 | return nonseekable_open(inode, file); |
1556 | } | 1561 | } |
@@ -1566,11 +1571,15 @@ static int cs4297a_release_mixdev(struct inode *inode, struct file *file) | |||
1566 | } | 1571 | } |
1567 | 1572 | ||
1568 | 1573 | ||
1569 | static int cs4297a_ioctl_mixdev(struct inode *inode, struct file *file, | 1574 | static int cs4297a_ioctl_mixdev(struct file *file, |
1570 | unsigned int cmd, unsigned long arg) | 1575 | unsigned int cmd, unsigned long arg) |
1571 | { | 1576 | { |
1572 | return mixer_ioctl((struct cs4297a_state *) file->private_data, cmd, | 1577 | int ret; |
1578 | lock_kernel(); | ||
1579 | ret = mixer_ioctl((struct cs4297a_state *) file->private_data, cmd, | ||
1573 | arg); | 1580 | arg); |
1581 | unlock_kernel(); | ||
1582 | return ret; | ||
1574 | } | 1583 | } |
1575 | 1584 | ||
1576 | 1585 | ||
@@ -1580,7 +1589,7 @@ static int cs4297a_ioctl_mixdev(struct inode *inode, struct file *file, | |||
1580 | static const struct file_operations cs4297a_mixer_fops = { | 1589 | static const struct file_operations cs4297a_mixer_fops = { |
1581 | .owner = THIS_MODULE, | 1590 | .owner = THIS_MODULE, |
1582 | .llseek = no_llseek, | 1591 | .llseek = no_llseek, |
1583 | .ioctl = cs4297a_ioctl_mixdev, | 1592 | .unlocked_ioctl = cs4297a_ioctl_mixdev, |
1584 | .open = cs4297a_open_mixdev, | 1593 | .open = cs4297a_open_mixdev, |
1585 | .release = cs4297a_release_mixdev, | 1594 | .release = cs4297a_release_mixdev, |
1586 | }; | 1595 | }; |
@@ -1944,7 +1953,7 @@ static int cs4297a_mmap(struct file *file, struct vm_area_struct *vma) | |||
1944 | } | 1953 | } |
1945 | 1954 | ||
1946 | 1955 | ||
1947 | static int cs4297a_ioctl(struct inode *inode, struct file *file, | 1956 | static int cs4297a_ioctl(struct file *file, |
1948 | unsigned int cmd, unsigned long arg) | 1957 | unsigned int cmd, unsigned long arg) |
1949 | { | 1958 | { |
1950 | struct cs4297a_state *s = | 1959 | struct cs4297a_state *s = |
@@ -2337,6 +2346,16 @@ static int cs4297a_ioctl(struct inode *inode, struct file *file, | |||
2337 | return mixer_ioctl(s, cmd, arg); | 2346 | return mixer_ioctl(s, cmd, arg); |
2338 | } | 2347 | } |
2339 | 2348 | ||
2349 | static long cs4297a_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) | ||
2350 | { | ||
2351 | int ret; | ||
2352 | |||
2353 | lock_kernel(); | ||
2354 | ret = cs4297a_ioctl(file, cmd, arg); | ||
2355 | unlock_kernel(); | ||
2356 | |||
2357 | return ret; | ||
2358 | } | ||
2340 | 2359 | ||
2341 | static int cs4297a_release(struct inode *inode, struct file *file) | 2360 | static int cs4297a_release(struct inode *inode, struct file *file) |
2342 | { | 2361 | { |
@@ -2369,7 +2388,7 @@ static int cs4297a_release(struct inode *inode, struct file *file) | |||
2369 | return 0; | 2388 | return 0; |
2370 | } | 2389 | } |
2371 | 2390 | ||
2372 | static int cs4297a_open(struct inode *inode, struct file *file) | 2391 | static int cs4297a_locked_open(struct inode *inode, struct file *file) |
2373 | { | 2392 | { |
2374 | int minor = iminor(inode); | 2393 | int minor = iminor(inode); |
2375 | struct cs4297a_state *s=NULL; | 2394 | struct cs4297a_state *s=NULL; |
@@ -2486,6 +2505,16 @@ static int cs4297a_open(struct inode *inode, struct file *file) | |||
2486 | return nonseekable_open(inode, file); | 2505 | return nonseekable_open(inode, file); |
2487 | } | 2506 | } |
2488 | 2507 | ||
2508 | static int cs4297a_open(struct inode *inode, struct file *file) | ||
2509 | { | ||
2510 | int ret; | ||
2511 | |||
2512 | lock_kernel(); | ||
2513 | ret = cs4297a_open(inode, file); | ||
2514 | unlock_kernel(); | ||
2515 | |||
2516 | return ret; | ||
2517 | } | ||
2489 | 2518 | ||
2490 | // ****************************************************************************************** | 2519 | // ****************************************************************************************** |
2491 | // Wave (audio) file operations struct. | 2520 | // Wave (audio) file operations struct. |
@@ -2496,7 +2525,7 @@ static const struct file_operations cs4297a_audio_fops = { | |||
2496 | .read = cs4297a_read, | 2525 | .read = cs4297a_read, |
2497 | .write = cs4297a_write, | 2526 | .write = cs4297a_write, |
2498 | .poll = cs4297a_poll, | 2527 | .poll = cs4297a_poll, |
2499 | .ioctl = cs4297a_ioctl, | 2528 | .unlocked_ioctl = cs4297a_unlocked_ioctl, |
2500 | .mmap = cs4297a_mmap, | 2529 | .mmap = cs4297a_mmap, |
2501 | .open = cs4297a_open, | 2530 | .open = cs4297a_open, |
2502 | .release = cs4297a_release, | 2531 | .release = cs4297a_release, |