Skip to content

Commit c926979

Browse files
covanamKAGA-KOKO
authored andcommitted
rtc: class: Switch to use hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Patch was created by using Coccinelle. Signed-off-by: Nam Cao <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Zack Rusin <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/all/22f3f087ddbab1708583033c07c3b7fb17810110.1738746904.git.namcao@linutronix.de
1 parent b701192 commit c926979

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/rtc/class.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ static struct rtc_device *rtc_allocate_device(void)
240240
/* Init uie timer */
241241
rtc_timer_init(&rtc->uie_rtctimer, rtc_uie_update_irq, rtc);
242242
/* Init pie timer */
243-
hrtimer_init(&rtc->pie_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
244-
rtc->pie_timer.function = rtc_pie_update_irq;
243+
hrtimer_setup(&rtc->pie_timer, rtc_pie_update_irq, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
245244
rtc->pie_enabled = 0;
246245

247246
set_bit(RTC_FEATURE_ALARM, rtc->features);

0 commit comments

Comments
 (0)