Skip to content

Commit a9d0ac7

Browse files
covanamKAGA-KOKO
authored andcommitted
leds: trigger: pattern: 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]> Link: https://lore.kernel.org/all/76fa1cc9777a99a48f49f949abadc1c10af1bc64.1738746904.git.namcao@linutronix.de
1 parent c158a29 commit a9d0ac7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/leds/trigger/ledtrig-pattern.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ static int pattern_trig_activate(struct led_classdev *led_cdev)
483483
data->led_cdev = led_cdev;
484484
led_set_trigger_data(led_cdev, data);
485485
timer_setup(&data->timer, pattern_trig_timer_function, 0);
486-
hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
487-
data->hrtimer.function = pattern_trig_hrtimer_function;
486+
hrtimer_setup(&data->hrtimer, pattern_trig_hrtimer_function, CLOCK_MONOTONIC,
487+
HRTIMER_MODE_REL);
488488
led_cdev->activated = true;
489489

490490
if (led_cdev->flags & LED_INIT_DEFAULT_TRIGGER) {

0 commit comments

Comments
 (0)