Re: [PATCH v2 18/45] power: reset: ltc2952-poweroff: Switch to use hrtimer_setup()

Sebastian Reichel
2025-02-08T17:43:11Z

[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]

Hi,

On Wed, Feb 05, 2025 at 11:46:06AM +0100, Nam Cao wrote:
> 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.
>
> Acked-by: Zack Rusin <zack.rusin@broadcom.com>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> Cc: Sebastian Reichel <sre@kernel.org>

Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Greetings,

-- Sebastian

> ---
> drivers/power/reset/ltc2952-poweroff.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c
> index 1a6fc8d38e20..90c664d344d0 100644
> --- a/drivers/power/reset/ltc2952-poweroff.c
> +++ b/drivers/power/reset/ltc2952-poweroff.c
> @@ -162,11 +162,11 @@ static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
> data->wde_interval = 300L * NSEC_PER_MSEC;
> data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC);
>
> - hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
> + hrtimer_setup(&data->timer_trigger, ltc2952_poweroff_timer_trigger, CLOCK_MONOTONIC,
> + HRTIMER_MODE_REL);
>
> - hrtimer_init(&data->timer_wde, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - data->timer_wde.function = ltc2952_poweroff_timer_wde;
> + hrtimer_setup(&data->timer_wde, ltc2952_poweroff_timer_wde, CLOCK_MONOTONIC,
> + HRTIMER_MODE_REL);
> }
>
> static int ltc2952_poweroff_init(struct platform_device *pdev)
> --
> 2.39.5
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]