summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/dev.c')
-rw-r--r--drivers/rtc/dev.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/rtc/dev.c b/drivers/rtc/dev.c
index f68aae035b81..84feb2565abd 100644
--- a/drivers/rtc/dev.c
+++ b/drivers/rtc/dev.c
@@ -57,7 +57,7 @@ static void rtc_uie_task(struct work_struct *work)
57 } else if (rtc->oldsecs != tm.tm_sec) { 57 } else if (rtc->oldsecs != tm.tm_sec) {
58 num = (tm.tm_sec + 60 - rtc->oldsecs) % 60; 58 num = (tm.tm_sec + 60 - rtc->oldsecs) % 60;
59 rtc->oldsecs = tm.tm_sec; 59 rtc->oldsecs = tm.tm_sec;
60 rtc->uie_timer.expires = jiffies + HZ - (HZ/10); 60 rtc->uie_timer.expires = jiffies + HZ - (HZ / 10);
61 rtc->uie_timer_active = 1; 61 rtc->uie_timer_active = 1;
62 rtc->uie_task_active = 0; 62 rtc->uie_task_active = 0;
63 add_timer(&rtc->uie_timer); 63 add_timer(&rtc->uie_timer);
@@ -68,6 +68,7 @@ static void rtc_uie_task(struct work_struct *work)
68 if (num) 68 if (num)
69 rtc_handle_legacy_irq(rtc, num, RTC_UF); 69 rtc_handle_legacy_irq(rtc, num, RTC_UF);
70} 70}
71
71static void rtc_uie_timer(struct timer_list *t) 72static void rtc_uie_timer(struct timer_list *t)
72{ 73{
73 struct rtc_device *rtc = from_timer(rtc, t, uie_timer); 74 struct rtc_device *rtc = from_timer(rtc, t, uie_timer);
@@ -199,14 +200,14 @@ static __poll_t rtc_dev_poll(struct file *file, poll_table *wait)
199} 200}
200 201
201static long rtc_dev_ioctl(struct file *file, 202static long rtc_dev_ioctl(struct file *file,
202 unsigned int cmd, unsigned long arg) 203 unsigned int cmd, unsigned long arg)
203{ 204{
204 int err = 0; 205 int err = 0;
205 struct rtc_device *rtc = file->private_data; 206 struct rtc_device *rtc = file->private_data;
206 const struct rtc_class_ops *ops = rtc->ops; 207 const struct rtc_class_ops *ops = rtc->ops;
207 struct rtc_time tm; 208 struct rtc_time tm;
208 struct rtc_wkalrm alarm; 209 struct rtc_wkalrm alarm;
209 void __user *uarg = (void __user *) arg; 210 void __user *uarg = (void __user *)arg;
210 211
211 err = mutex_lock_interruptible(&rtc->ops_lock); 212 err = mutex_lock_interruptible(&rtc->ops_lock);
212 if (err) 213 if (err)
@@ -230,7 +231,7 @@ static long rtc_dev_ioctl(struct file *file,
230 231
231 case RTC_PIE_ON: 232 case RTC_PIE_ON:
232 if (rtc->irq_freq > rtc->max_user_freq && 233 if (rtc->irq_freq > rtc->max_user_freq &&
233 !capable(CAP_SYS_RESOURCE)) 234 !capable(CAP_SYS_RESOURCE))
234 err = -EACCES; 235 err = -EACCES;
235 break; 236 break;
236 } 237 }
@@ -387,8 +388,9 @@ static long rtc_dev_ioctl(struct file *file,
387 err = ops->ioctl(rtc->dev.parent, cmd, arg); 388 err = ops->ioctl(rtc->dev.parent, cmd, arg);
388 if (err == -ENOIOCTLCMD) 389 if (err == -ENOIOCTLCMD)
389 err = -ENOTTY; 390 err = -ENOTTY;
390 } else 391 } else {
391 err = -ENOTTY; 392 err = -ENOTTY;
393 }
392 break; 394 break;
393 } 395 }
394 396
@@ -400,6 +402,7 @@ done:
400static int rtc_dev_fasync(int fd, struct file *file, int on) 402static int rtc_dev_fasync(int fd, struct file *file, int on)
401{ 403{
402 struct rtc_device *rtc = file->private_data; 404 struct rtc_device *rtc = file->private_data;
405
403 return fasync_helper(fd, file, on, &rtc->async_queue); 406 return fasync_helper(fd, file, on, &rtc->async_queue);
404} 407}
405 408