]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PM: runtime: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:39:12 +0000 (11:39 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:32:34 +0000 (10:32 +0100)
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 <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/all/8d1ce108b043896733ce08d3deea6e84941d499b.1738746821.git.namcao@linutronix.de
drivers/base/power/runtime.c

index 2ee45841486bc73225b3e971164466647b3ce6d3..425c43b2d478abe2fa8abdacfab2e3ca52307f40 100644 (file)
@@ -1764,8 +1764,8 @@ void pm_runtime_init(struct device *dev)
        INIT_WORK(&dev->power.work, pm_runtime_work);
 
        dev->power.timer_expires = 0;
-       hrtimer_init(&dev->power.suspend_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
-       dev->power.suspend_timer.function = pm_suspend_timer_fn;
+       hrtimer_setup(&dev->power.suspend_timer, pm_suspend_timer_fn, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_ABS);
 
        init_waitqueue_head(&dev->power.wait_queue);
 }