summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r--drivers/rtc/interface.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 612a83d3ddcc..98d9c87b0d1b 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -368,12 +368,8 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
368 err = rtc_valid_tm(&alarm->time); 368 err = rtc_valid_tm(&alarm->time);
369 369
370done: 370done:
371 if (err) { 371 if (err)
372 dev_warn(&rtc->dev, "invalid alarm value: %d-%d-%d %d:%d:%d\n", 372 dev_warn(&rtc->dev, "invalid alarm value: %ptR\n", &alarm->time);
373 alarm->time.tm_year + 1900, alarm->time.tm_mon + 1,
374 alarm->time.tm_mday, alarm->time.tm_hour, alarm->time.tm_min,
375 alarm->time.tm_sec);
376 }
377 373
378 return err; 374 return err;
379} 375}
@@ -613,26 +609,24 @@ void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode)
613 609
614/** 610/**
615 * rtc_aie_update_irq - AIE mode rtctimer hook 611 * rtc_aie_update_irq - AIE mode rtctimer hook
616 * @private: pointer to the rtc_device 612 * @rtc: pointer to the rtc_device
617 * 613 *
618 * This functions is called when the aie_timer expires. 614 * This functions is called when the aie_timer expires.
619 */ 615 */
620void rtc_aie_update_irq(void *private) 616void rtc_aie_update_irq(struct rtc_device *rtc)
621{ 617{
622 struct rtc_device *rtc = (struct rtc_device *)private;
623 rtc_handle_legacy_irq(rtc, 1, RTC_AF); 618 rtc_handle_legacy_irq(rtc, 1, RTC_AF);
624} 619}
625 620
626 621
627/** 622/**
628 * rtc_uie_update_irq - UIE mode rtctimer hook 623 * rtc_uie_update_irq - UIE mode rtctimer hook
629 * @private: pointer to the rtc_device 624 * @rtc: pointer to the rtc_device
630 * 625 *
631 * This functions is called when the uie_timer expires. 626 * This functions is called when the uie_timer expires.
632 */ 627 */
633void rtc_uie_update_irq(void *private) 628void rtc_uie_update_irq(struct rtc_device *rtc)
634{ 629{
635 struct rtc_device *rtc = (struct rtc_device *)private;
636 rtc_handle_legacy_irq(rtc, 1, RTC_UF); 630 rtc_handle_legacy_irq(rtc, 1, RTC_UF);
637} 631}
638 632
@@ -912,7 +906,7 @@ again:
912 trace_rtc_timer_dequeue(timer); 906 trace_rtc_timer_dequeue(timer);
913 timer->enabled = 0; 907 timer->enabled = 0;
914 if (timer->func) 908 if (timer->func)
915 timer->func(timer->private_data); 909 timer->func(timer->rtc);
916 910
917 trace_rtc_timer_fired(timer); 911 trace_rtc_timer_fired(timer);
918 /* Re-add/fwd periodic timers */ 912 /* Re-add/fwd periodic timers */
@@ -959,16 +953,17 @@ reprogram:
959/* rtc_timer_init - Initializes an rtc_timer 953/* rtc_timer_init - Initializes an rtc_timer
960 * @timer: timer to be intiialized 954 * @timer: timer to be intiialized
961 * @f: function pointer to be called when timer fires 955 * @f: function pointer to be called when timer fires
962 * @data: private data passed to function pointer 956 * @rtc: pointer to the rtc_device
963 * 957 *
964 * Kernel interface to initializing an rtc_timer. 958 * Kernel interface to initializing an rtc_timer.
965 */ 959 */
966void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data) 960void rtc_timer_init(struct rtc_timer *timer, void (*f)(struct rtc_device *r),
961 struct rtc_device *rtc)
967{ 962{
968 timerqueue_init(&timer->node); 963 timerqueue_init(&timer->node);
969 timer->enabled = 0; 964 timer->enabled = 0;
970 timer->func = f; 965 timer->func = f;
971 timer->private_data = data; 966 timer->rtc = rtc;
972} 967}
973 968
974/* rtc_timer_start - Sets an rtc_timer to fire in the future 969/* rtc_timer_start - Sets an rtc_timer to fire in the future