aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/crystalhd/crystalhd_lnx.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-04-27 14:15:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-11 14:35:36 -0400
commitb1f2ac07636aadee5cb077fc7e830908b00fcaae (patch)
tree852211194d15c11389037dce6c413270683c4f26 /drivers/staging/crystalhd/crystalhd_lnx.c
parent59200df52cf7d4bfb93aeb30289a8e9d2af3058d (diff)
Staging: push down BKL into ioctl functions
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/crystalhd/crystalhd_lnx.c')
-rw-r--r--drivers/staging/crystalhd/crystalhd_lnx.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 58fd91af091..6090a1d5954 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -16,6 +16,7 @@
16***************************************************************************/ 16***************************************************************************/
17 17
18#include <linux/version.h> 18#include <linux/version.h>
19#include <linux/smp_lock.h>
19#include <linux/slab.h> 20#include <linux/slab.h>
20 21
21#include "crystalhd_lnx.h" 22#include "crystalhd_lnx.h"
@@ -261,12 +262,12 @@ static int chd_dec_api_cmd(struct crystalhd_adp *adp, unsigned long ua,
261} 262}
262 263
263/* API interfaces */ 264/* API interfaces */
264static int chd_dec_ioctl(struct inode *in, struct file *fd, 265static long chd_dec_ioctl(struct file *fd, unsigned int cmd, unsigned long ua)
265 unsigned int cmd, unsigned long ua)
266{ 266{
267 struct crystalhd_adp *adp = chd_get_adp(); 267 struct crystalhd_adp *adp = chd_get_adp();
268 crystalhd_cmd_proc cproc; 268 crystalhd_cmd_proc cproc;
269 struct crystalhd_user *uc; 269 struct crystalhd_user *uc;
270 int ret;
270 271
271 if (!adp || !fd) { 272 if (!adp || !fd) {
272 BCMLOG_ERR("Invalid adp\n"); 273 BCMLOG_ERR("Invalid adp\n");
@@ -279,13 +280,17 @@ static int chd_dec_ioctl(struct inode *in, struct file *fd,
279 return -ENODATA; 280 return -ENODATA;
280 } 281 }
281 282
283 lock_kernel();
282 cproc = crystalhd_get_cmd_proc(&adp->cmds, cmd, uc); 284 cproc = crystalhd_get_cmd_proc(&adp->cmds, cmd, uc);
283 if (!cproc) { 285 if (!cproc) {
284 BCMLOG_ERR("Unhandled command: %d\n", cmd); 286 BCMLOG_ERR("Unhandled command: %d\n", cmd);
287 unlock_kernel();
285 return -EINVAL; 288 return -EINVAL;
286 } 289 }
287 290
288 return chd_dec_api_cmd(adp, ua, uc->uid, cmd, cproc); 291 ret = chd_dec_api_cmd(adp, ua, uc->uid, cmd, cproc);
292 unlock_kernel();
293 return ret;
289} 294}
290 295
291static int chd_dec_open(struct inode *in, struct file *fd) 296static int chd_dec_open(struct inode *in, struct file *fd)
@@ -345,7 +350,7 @@ static int chd_dec_close(struct inode *in, struct file *fd)
345 350
346static const struct file_operations chd_dec_fops = { 351static const struct file_operations chd_dec_fops = {
347 .owner = THIS_MODULE, 352 .owner = THIS_MODULE,
348 .ioctl = chd_dec_ioctl, 353 .unlocked_ioctl = chd_dec_ioctl,
349 .open = chd_dec_open, 354 .open = chd_dec_open,
350 .release = chd_dec_close, 355 .release = chd_dec_close,
351}; 356};