diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-12-18 22:11:26 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-12-18 22:53:29 +0100 |
commit | 9a03201170d3de1da47c1b7e2d514e0b15477881 (patch) | |
tree | 30e9415bb7fa8fc3a2bb0d81c466b51f41af2459 /drivers/rtc/interface.c | |
parent | ffe1c5a2d4271a0e04e2576ab0a53ac09a14e065 (diff) | |
download | linux-9a03201170d3de1da47c1b7e2d514e0b15477881.tar.bz2 |
rtc: enforce rtc_timer_init private_data type
All the remaining users of rtc_timers are passing the rtc_device as private
data. Enforce that and rename private_data to rtc.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r-- | drivers/rtc/interface.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index e8d77b1eaeb2..98d9c87b0d1b 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -609,26 +609,24 @@ void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode) /** * rtc_aie_update_irq - AIE mode rtctimer hook - * @private: pointer to the rtc_device + * @rtc: pointer to the rtc_device * * This functions is called when the aie_timer expires. */ -void rtc_aie_update_irq(void *private) +void rtc_aie_update_irq(struct rtc_device *rtc) { - struct rtc_device *rtc = (struct rtc_device *)private; rtc_handle_legacy_irq(rtc, 1, RTC_AF); } /** * rtc_uie_update_irq - UIE mode rtctimer hook - * @private: pointer to the rtc_device + * @rtc: pointer to the rtc_device * * This functions is called when the uie_timer expires. */ -void rtc_uie_update_irq(void *private) +void rtc_uie_update_irq(struct rtc_device *rtc) { - struct rtc_device *rtc = (struct rtc_device *)private; rtc_handle_legacy_irq(rtc, 1, RTC_UF); } @@ -908,7 +906,7 @@ again: trace_rtc_timer_dequeue(timer); timer->enabled = 0; if (timer->func) - timer->func(timer->private_data); + timer->func(timer->rtc); trace_rtc_timer_fired(timer); /* Re-add/fwd periodic timers */ @@ -955,16 +953,17 @@ reprogram: /* rtc_timer_init - Initializes an rtc_timer * @timer: timer to be intiialized * @f: function pointer to be called when timer fires - * @data: private data passed to function pointer + * @rtc: pointer to the rtc_device * * Kernel interface to initializing an rtc_timer. */ -void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data) +void rtc_timer_init(struct rtc_timer *timer, void (*f)(struct rtc_device *r), + struct rtc_device *rtc) { timerqueue_init(&timer->node); timer->enabled = 0; timer->func = f; - timer->private_data = data; + timer->rtc = rtc; } /* rtc_timer_start - Sets an rtc_timer to fire in the future |