Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pwm: gpio: 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.

Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Signed-off-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/7b7115da84372a49e36a0ac1a5ce553129c3ce0b.1738746904.git.namcao@linutronix.de
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

authored by

Nam Cao and committed by
Uwe Kleine-König
e320a240 c98e6614

+2 -3
+2 -3
drivers/pwm/pwm-gpio.c
··· 207 207 chip->ops = &pwm_gpio_ops; 208 208 chip->atomic = true; 209 209 210 - hrtimer_init(&gpwm->gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 210 + hrtimer_setup(&gpwm->gpio_timer, pwm_gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 211 + 211 212 ret = devm_add_action_or_reset(dev, pwm_gpio_disable_hrtimer, gpwm); 212 213 if (ret) 213 214 return ret; 214 - 215 - gpwm->gpio_timer.function = pwm_gpio_timer; 216 215 217 216 ret = pwmchip_add(chip); 218 217 if (ret < 0)