aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-04-26 18:24:02 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-16 23:27:05 -0400
commit703c631ebbcadcfd861d01e697fdda7c388fec9a (patch)
tree7c93468e7c898f448a330ce266d6b9205238d64a /drivers/isdn
parentf4927c45beda9a70e5c3bda0bd9f12b4f713c00b (diff)
isdn: Push down BKL into ioctl functions
Push down bkl into isdn ioctl functions [fweisbec: dropped drivers/isdn/divert/divert_procfs.c as it has been pushed down in procfs branch already] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/capi/capi.c17
-rw-r--r--drivers/isdn/i4l/isdn_common.c18
-rw-r--r--drivers/isdn/mISDN/timerdev.c10
3 files changed, 35 insertions, 10 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index ee5837522f5a..0cabe31f26df 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -787,8 +787,7 @@ capi_poll(struct file *file, poll_table * wait)
787} 787}
788 788
789static int 789static int
790capi_ioctl(struct inode *inode, struct file *file, 790capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
791 unsigned int cmd, unsigned long arg)
792{ 791{
793 struct capidev *cdev = file->private_data; 792 struct capidev *cdev = file->private_data;
794 capi_ioctl_struct data; 793 capi_ioctl_struct data;
@@ -981,6 +980,18 @@ register_out:
981 } 980 }
982} 981}
983 982
983static long
984capi_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
985{
986 int ret;
987
988 lock_kernel();
989 ret = capi_ioctl(file, cmd, arg);
990 unlock_kernel();
991
992 return ret;
993}
994
984static int capi_open(struct inode *inode, struct file *file) 995static int capi_open(struct inode *inode, struct file *file)
985{ 996{
986 struct capidev *cdev; 997 struct capidev *cdev;
@@ -1026,7 +1037,7 @@ static const struct file_operations capi_fops =
1026 .read = capi_read, 1037 .read = capi_read,
1027 .write = capi_write, 1038 .write = capi_write,
1028 .poll = capi_poll, 1039 .poll = capi_poll,
1029 .ioctl = capi_ioctl, 1040 .unlocked_ioctl = capi_unlocked_ioctl,
1030 .open = capi_open, 1041 .open = capi_open,
1031 .release = capi_release, 1042 .release = capi_release,
1032}; 1043};
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 70044ee4b228..a44cdb492ea9 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1272,9 +1272,9 @@ isdn_poll(struct file *file, poll_table * wait)
1272 1272
1273 1273
1274static int 1274static int
1275isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) 1275isdn_ioctl(struct file *file, uint cmd, ulong arg)
1276{ 1276{
1277 uint minor = iminor(inode); 1277 uint minor = iminor(file->f_path.dentry->d_inode);
1278 isdn_ctrl c; 1278 isdn_ctrl c;
1279 int drvidx; 1279 int drvidx;
1280 int chidx; 1280 int chidx;
@@ -1722,6 +1722,18 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
1722#undef cfg 1722#undef cfg
1723} 1723}
1724 1724
1725static long
1726isdn_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1727{
1728 int ret;
1729
1730 lock_kernel();
1731 ret = isdn_ioctl(file, cmd, arg);
1732 unlock_kernel();
1733
1734 return ret;
1735}
1736
1725/* 1737/*
1726 * Open the device code. 1738 * Open the device code.
1727 */ 1739 */
@@ -1838,7 +1850,7 @@ static const struct file_operations isdn_fops =
1838 .read = isdn_read, 1850 .read = isdn_read,
1839 .write = isdn_write, 1851 .write = isdn_write,
1840 .poll = isdn_poll, 1852 .poll = isdn_poll,
1841 .ioctl = isdn_ioctl, 1853 .unlocked_ioctl = isdn_unlocked_ioctl,
1842 .open = isdn_open, 1854 .open = isdn_open,
1843 .release = isdn_close, 1855 .release = isdn_close,
1844}; 1856};
diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c
index 8785004e85e0..c3243c913ec0 100644
--- a/drivers/isdn/mISDN/timerdev.c
+++ b/drivers/isdn/mISDN/timerdev.c
@@ -24,6 +24,7 @@
24#include <linux/miscdevice.h> 24#include <linux/miscdevice.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/mISDNif.h> 26#include <linux/mISDNif.h>
27#include <linux/smp_lock.h>
27#include "core.h" 28#include "core.h"
28 29
29static u_int *debug; 30static u_int *debug;
@@ -215,9 +216,8 @@ unlock:
215 return ret; 216 return ret;
216} 217}
217 218
218static int 219static long
219mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, 220mISDN_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
220 unsigned long arg)
221{ 221{
222 struct mISDNtimerdev *dev = filep->private_data; 222 struct mISDNtimerdev *dev = filep->private_data;
223 int id, tout, ret = 0; 223 int id, tout, ret = 0;
@@ -226,6 +226,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
226 if (*debug & DEBUG_TIMER) 226 if (*debug & DEBUG_TIMER)
227 printk(KERN_DEBUG "%s(%p, %x, %lx)\n", __func__, 227 printk(KERN_DEBUG "%s(%p, %x, %lx)\n", __func__,
228 filep, cmd, arg); 228 filep, cmd, arg);
229 lock_kernel();
229 switch (cmd) { 230 switch (cmd) {
230 case IMADDTIMER: 231 case IMADDTIMER:
231 if (get_user(tout, (int __user *)arg)) { 232 if (get_user(tout, (int __user *)arg)) {
@@ -257,13 +258,14 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
257 default: 258 default:
258 ret = -EINVAL; 259 ret = -EINVAL;
259 } 260 }
261 unlock_kernel();
260 return ret; 262 return ret;
261} 263}
262 264
263static const struct file_operations mISDN_fops = { 265static const struct file_operations mISDN_fops = {
264 .read = mISDN_read, 266 .read = mISDN_read,
265 .poll = mISDN_poll, 267 .poll = mISDN_poll,
266 .ioctl = mISDN_ioctl, 268 .unlocked_ioctl = mISDN_ioctl,
267 .open = mISDN_open, 269 .open = mISDN_open,
268 .release = mISDN_close, 270 .release = mISDN_close,
269}; 271};