Skip to content

Commit 563608c

Browse files
covanamKAGA-KOKO
authored andcommitted
power: reset: ltc2952-poweroff: 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: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/all/75ef5206f52f194b9c51653628cd2d0b083a482f.1738746904.git.namcao@linutronix.de
1 parent 1b73fd1 commit 563608c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/power/reset/ltc2952-poweroff.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
162162
data->wde_interval = 300L * NSEC_PER_MSEC;
163163
data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC);
164164

165-
hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
166-
data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
165+
hrtimer_setup(&data->timer_trigger, ltc2952_poweroff_timer_trigger, CLOCK_MONOTONIC,
166+
HRTIMER_MODE_REL);
167167

168-
hrtimer_init(&data->timer_wde, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
169-
data->timer_wde.function = ltc2952_poweroff_timer_wde;
168+
hrtimer_setup(&data->timer_wde, ltc2952_poweroff_timer_wde, CLOCK_MONOTONIC,
169+
HRTIMER_MODE_REL);
170170
}
171171

172172
static int ltc2952_poweroff_init(struct platform_device *pdev)

0 commit comments

Comments
 (0)