aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/genrtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/genrtc.c')
-rw-r--r--drivers/char/genrtc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index 31e7c91c2d9d..b6c2cc167c11 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -262,7 +262,7 @@ static inline int gen_set_rtc_irq_bit(unsigned char bit)
262#endif 262#endif
263} 263}
264 264
265static int gen_rtc_ioctl(struct inode *inode, struct file *file, 265static int gen_rtc_ioctl(struct file *file,
266 unsigned int cmd, unsigned long arg) 266 unsigned int cmd, unsigned long arg)
267{ 267{
268 struct rtc_time wtime; 268 struct rtc_time wtime;
@@ -332,6 +332,18 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
332 return -EINVAL; 332 return -EINVAL;
333} 333}
334 334
335static long gen_rtc_unlocked_ioctl(struct file *file, unsigned int cmd,
336 unsigned long arg)
337{
338 int ret;
339
340 lock_kernel();
341 ret = gen_rtc_ioctl(file, cmd, arg);
342 unlock_kernel();
343
344 return ret;
345}
346
335/* 347/*
336 * We enforce only one user at a time here with the open/close. 348 * We enforce only one user at a time here with the open/close.
337 * Also clear the previous interrupt data on an open, and clean 349 * Also clear the previous interrupt data on an open, and clean
@@ -482,7 +494,7 @@ static const struct file_operations gen_rtc_fops = {
482 .read = gen_rtc_read, 494 .read = gen_rtc_read,
483 .poll = gen_rtc_poll, 495 .poll = gen_rtc_poll,
484#endif 496#endif
485 .ioctl = gen_rtc_ioctl, 497 .unlocked_ioctl = gen_rtc_unlocked_ioctl,
486 .open = gen_rtc_open, 498 .open = gen_rtc_open,
487 .release = gen_rtc_release, 499 .release = gen_rtc_release,
488}; 500};