Skip to content

Commit e320a24

Browse files
covanamUwe Kleine-König
authored andcommitted
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>
1 parent c98e661 commit e320a24

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/pwm/pwm-gpio.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,12 @@ static int pwm_gpio_probe(struct platform_device *pdev)
207207
chip->ops = &pwm_gpio_ops;
208208
chip->atomic = true;
209209

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+
211212
ret = devm_add_action_or_reset(dev, pwm_gpio_disable_hrtimer, gpwm);
212213
if (ret)
213214
return ret;
214215

215-
gpwm->gpio_timer.function = pwm_gpio_timer;
216-
217216
ret = pwmchip_add(chip);
218217
if (ret < 0)
219218
return dev_err_probe(dev, ret, "could not add pwmchip\n");

0 commit comments

Comments
 (0)