aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/i4l
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/i4l')
-rw-r--r--drivers/isdn/i4l/isdn_common.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index a44cdb492ea9..15632bd2f643 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -17,7 +17,7 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/vmalloc.h> 18#include <linux/vmalloc.h>
19#include <linux/isdn.h> 19#include <linux/isdn.h>
20#include <linux/smp_lock.h> 20#include <linux/mutex.h>
21#include "isdn_common.h" 21#include "isdn_common.h"
22#include "isdn_tty.h" 22#include "isdn_tty.h"
23#include "isdn_net.h" 23#include "isdn_net.h"
@@ -42,6 +42,7 @@ MODULE_LICENSE("GPL");
42 42
43isdn_dev *dev; 43isdn_dev *dev;
44 44
45static DEFINE_MUTEX(isdn_mutex);
45static char *isdn_revision = "$Revision: 1.1.2.3 $"; 46static char *isdn_revision = "$Revision: 1.1.2.3 $";
46 47
47extern char *isdn_net_revision; 48extern char *isdn_net_revision;
@@ -1070,7 +1071,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
1070 int retval; 1071 int retval;
1071 char *p; 1072 char *p;
1072 1073
1073 lock_kernel(); 1074 mutex_lock(&isdn_mutex);
1074 if (minor == ISDN_MINOR_STATUS) { 1075 if (minor == ISDN_MINOR_STATUS) {
1075 if (!file->private_data) { 1076 if (!file->private_data) {
1076 if (file->f_flags & O_NONBLOCK) { 1077 if (file->f_flags & O_NONBLOCK) {
@@ -1163,7 +1164,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
1163#endif 1164#endif
1164 retval = -ENODEV; 1165 retval = -ENODEV;
1165 out: 1166 out:
1166 unlock_kernel(); 1167 mutex_unlock(&isdn_mutex);
1167 return retval; 1168 return retval;
1168} 1169}
1169 1170
@@ -1180,7 +1181,7 @@ isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off
1180 if (!dev->drivers) 1181 if (!dev->drivers)
1181 return -ENODEV; 1182 return -ENODEV;
1182 1183
1183 lock_kernel(); 1184 mutex_lock(&isdn_mutex);
1184 if (minor <= ISDN_MINOR_BMAX) { 1185 if (minor <= ISDN_MINOR_BMAX) {
1185 printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor); 1186 printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor);
1186 drvidx = isdn_minor2drv(minor); 1187 drvidx = isdn_minor2drv(minor);
@@ -1225,7 +1226,7 @@ isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off
1225#endif 1226#endif
1226 retval = -ENODEV; 1227 retval = -ENODEV;
1227 out: 1228 out:
1228 unlock_kernel(); 1229 mutex_unlock(&isdn_mutex);
1229 return retval; 1230 return retval;
1230} 1231}
1231 1232
@@ -1236,7 +1237,7 @@ isdn_poll(struct file *file, poll_table * wait)
1236 unsigned int minor = iminor(file->f_path.dentry->d_inode); 1237 unsigned int minor = iminor(file->f_path.dentry->d_inode);
1237 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL); 1238 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
1238 1239
1239 lock_kernel(); 1240 mutex_lock(&isdn_mutex);
1240 if (minor == ISDN_MINOR_STATUS) { 1241 if (minor == ISDN_MINOR_STATUS) {
1241 poll_wait(file, &(dev->info_waitq), wait); 1242 poll_wait(file, &(dev->info_waitq), wait);
1242 /* mask = POLLOUT | POLLWRNORM; */ 1243 /* mask = POLLOUT | POLLWRNORM; */
@@ -1266,7 +1267,7 @@ isdn_poll(struct file *file, poll_table * wait)
1266#endif 1267#endif
1267 mask = POLLERR; 1268 mask = POLLERR;
1268 out: 1269 out:
1269 unlock_kernel(); 1270 mutex_unlock(&isdn_mutex);
1270 return mask; 1271 return mask;
1271} 1272}
1272 1273
@@ -1727,9 +1728,9 @@ isdn_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1727{ 1728{
1728 int ret; 1729 int ret;
1729 1730
1730 lock_kernel(); 1731 mutex_lock(&isdn_mutex);
1731 ret = isdn_ioctl(file, cmd, arg); 1732 ret = isdn_ioctl(file, cmd, arg);
1732 unlock_kernel(); 1733 mutex_unlock(&isdn_mutex);
1733 1734
1734 return ret; 1735 return ret;
1735} 1736}
@@ -1745,7 +1746,7 @@ isdn_open(struct inode *ino, struct file *filep)
1745 int chidx; 1746 int chidx;
1746 int retval = -ENODEV; 1747 int retval = -ENODEV;
1747 1748
1748 lock_kernel(); 1749 mutex_lock(&isdn_mutex);
1749 if (minor == ISDN_MINOR_STATUS) { 1750 if (minor == ISDN_MINOR_STATUS) {
1750 infostruct *p; 1751 infostruct *p;
1751 1752
@@ -1796,7 +1797,7 @@ isdn_open(struct inode *ino, struct file *filep)
1796#endif 1797#endif
1797 out: 1798 out:
1798 nonseekable_open(ino, filep); 1799 nonseekable_open(ino, filep);
1799 unlock_kernel(); 1800 mutex_unlock(&isdn_mutex);
1800 return retval; 1801 return retval;
1801} 1802}
1802 1803
@@ -1805,7 +1806,7 @@ isdn_close(struct inode *ino, struct file *filep)
1805{ 1806{
1806 uint minor = iminor(ino); 1807 uint minor = iminor(ino);
1807 1808
1808 lock_kernel(); 1809 mutex_lock(&isdn_mutex);
1809 if (minor == ISDN_MINOR_STATUS) { 1810 if (minor == ISDN_MINOR_STATUS) {
1810 infostruct *p = dev->infochain; 1811 infostruct *p = dev->infochain;
1811 infostruct *q = NULL; 1812 infostruct *q = NULL;
@@ -1839,7 +1840,7 @@ isdn_close(struct inode *ino, struct file *filep)
1839#endif 1840#endif
1840 1841
1841 out: 1842 out:
1842 unlock_kernel(); 1843 mutex_unlock(&isdn_mutex);
1843 return 0; 1844 return 0;
1844} 1845}
1845 1846