diff options
author | Nam Cao <namcao@linutronix.de> | 2025-02-05 11:46:31 +0100 |
---|---|---|
committer | Uwe Kleine-König <ukleinek@kernel.org> | 2025-02-07 16:41:37 +0100 |
commit | e320a24059f8fd06c60a5cc295bcc53eff759d30 (patch) | |
tree | 18774fa719574b73c12cb28c8efece25c0efb174 /drivers/pwm/pwm-gpio.c | |
parent | c98e66144b7d07ee9a3ca8241123b628a8ac0288 (diff) | |
download | linux-stable-e320a24059f8fd06c60a5cc295bcc53eff759d30.tar.gz linux-stable-e320a24059f8fd06c60a5cc295bcc53eff759d30.tar.bz2 linux-stable-e320a24059f8fd06c60a5cc295bcc53eff759d30.zip |
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>
Diffstat (limited to 'drivers/pwm/pwm-gpio.c')
-rw-r--r-- | drivers/pwm/pwm-gpio.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-gpio.c b/drivers/pwm/pwm-gpio.c index 9f8884ac7504..5f4edeb394a9 100644 --- a/drivers/pwm/pwm-gpio.c +++ b/drivers/pwm/pwm-gpio.c @@ -207,13 +207,12 @@ static int pwm_gpio_probe(struct platform_device *pdev) chip->ops = &pwm_gpio_ops; chip->atomic = true; - hrtimer_init(&gpwm->gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); + hrtimer_setup(&gpwm->gpio_timer, pwm_gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); + ret = devm_add_action_or_reset(dev, pwm_gpio_disable_hrtimer, gpwm); if (ret) return ret; - gpwm->gpio_timer.function = pwm_gpio_timer; - ret = pwmchip_add(chip); if (ret < 0) return dev_err_probe(dev, ret, "could not add pwmchip\n"); |