Skip to content

Commit 1b73fd1

Browse files
covanamKAGA-KOKO
authored andcommitted
power: supply: ab8500_chargalg: 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]> Reviewed-by: Linus Walleij <[email protected]> Acked-by: Zack Rusin <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/all/fa0bf7376ce8f124c8285a52d9f55d0ab4c42988.1738746904.git.namcao@linutronix.de
1 parent d9a6724 commit 1b73fd1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/power/supply/ab8500_chargalg.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,13 +1787,12 @@ static int ab8500_chargalg_probe(struct platform_device *pdev)
17871787
psy_cfg.drv_data = di;
17881788

17891789
/* Initilialize safety timer */
1790-
hrtimer_init(&di->safety_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
1791-
di->safety_timer.function = ab8500_chargalg_safety_timer_expired;
1790+
hrtimer_setup(&di->safety_timer, ab8500_chargalg_safety_timer_expired, CLOCK_MONOTONIC,
1791+
HRTIMER_MODE_REL);
17921792

17931793
/* Initilialize maintenance timer */
1794-
hrtimer_init(&di->maintenance_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
1795-
di->maintenance_timer.function =
1796-
ab8500_chargalg_maintenance_timer_expired;
1794+
hrtimer_setup(&di->maintenance_timer, ab8500_chargalg_maintenance_timer_expired,
1795+
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
17971796

17981797
/* Init work for chargalg */
17991798
INIT_DEFERRABLE_WORK(&di->chargalg_periodic_work,

0 commit comments

Comments
 (0)