diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-01 16:24:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-01 16:24:31 -0500 |
commit | 28e8c4bc8eb483c22d977e147a0b98fc63efadf7 (patch) | |
tree | 8006dd759601c70d4dd1fc644ed817e9597cec55 /drivers/rtc/interface.c | |
parent | c9bef4a651769927445900564781a9c99fdf6258 (diff) | |
parent | 36e14f5fdfdf7cec8887b7ff69cd9bb5051ecf62 (diff) |
Merge tag 'rtc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni:
"Subsystem:
- new %ptR printk format
- rename core files
- allow registration of multiple nvmem devices
New driver:
- i.MX system controller RTC
Driver updates:
- abx80x: handle voltage ioctls, correct binding doc
- m41t80: correct month in alarm reads
- pcf85363: add pcf85263 support
- pcf8523: properly handle battery low flag
- s3c: limit alarm to one year in the future as ALMYEAR is broken
- sun6i: rework clock output binding"
* tag 'rtc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (54 commits)
rtc: rename core files
rtc: nvmem: fix possible use after free
rtc: add i.MX system controller RTC support
dt-bindings: fsl: scu: add rtc binding
rtc: pcf2123: Add Microcrystal rv2123
rtc: class: reimplement devm_rtc_device_register
rtc: enforce rtc_timer_init private_data type
rtc: abx80x: Implement RTC_VL_READ,CLR ioctls
rtc: pcf85363: Add support for NXP pcf85263 rtc
dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
rtc: pcf8523: don't return invalid date when battery is low
dt-bindings: rtc: use a generic node name for ds1307
PM: Switch to use %ptR
m68k/mac: Switch to use %ptR
Input: hp_sdc_rtc - Switch to use %ptR
rtc: tegra: Switch to use %ptR
rtc: s5m: Switch to use %ptR
rtc: s3c: Switch to use %ptR
rtc: rx8025: Switch to use %ptR
rtc: rx6110: Switch to use %ptR
...
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r-- | drivers/rtc/interface.c | 27 |
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 | ||
370 | done: | 370 | done: |
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 | */ |
620 | void rtc_aie_update_irq(void *private) | 616 | void 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 | */ |
633 | void rtc_uie_update_irq(void *private) | 628 | void 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 | */ |
966 | void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data) | 960 | void 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 |