diff options
| author | Nam Cao <[email protected]> | 2025-02-05 10:46:13 +0000 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2025-02-18 10:19:05 +0000 |
| commit | a9d0ac739658f9a7c27d3430475aa3a00948ab1f (patch) | |
| tree | d00e7bc657ec07e6cb17e3cea05e832dc85127bf | |
| parent | mailbox: Switch to use hrtimer_setup() (diff) | |
| download | kernel-a9d0ac739658f9a7c27d3430475aa3a00948ab1f.tar.gz kernel-a9d0ac739658f9a7c27d3430475aa3a00948ab1f.zip | |
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
| -rw-r--r-- | drivers/leds/trigger/ledtrig-pattern.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c index aad48c2540fc..a594bd5e2233 100644 --- a/drivers/leds/trigger/ledtrig-pattern.c +++ b/drivers/leds/trigger/ledtrig-pattern.c @@ -483,8 +483,8 @@ static int pattern_trig_activate(struct led_classdev *led_cdev) data->led_cdev = led_cdev; led_set_trigger_data(led_cdev, data); timer_setup(&data->timer, pattern_trig_timer_function, 0); - hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - data->hrtimer.function = pattern_trig_hrtimer_function; + hrtimer_setup(&data->hrtimer, pattern_trig_hrtimer_function, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); led_cdev->activated = true; if (led_cdev->flags & LED_INIT_DEFAULT_TRIGGER) { |
