]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i2c: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:16 +0000 (11:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:05 +0000 (11:19 +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: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/6a0d31244560b76cc7e76954bf68dbe14a4761e3.1738746904.git.namcao@linutronix.de
drivers/i2c/busses/i2c-imx.c

index ee0d25b498cb2c4f0eae39cf87d9bf67ef965075..9e5d454d8318e819095b41c052aa08f35d9a2816 100644 (file)
@@ -1723,8 +1723,8 @@ static int i2c_imx_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        spin_lock_init(&i2c_imx->slave_lock);
-       hrtimer_init(&i2c_imx->slave_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
-       i2c_imx->slave_timer.function = i2c_imx_slave_timeout;
+       hrtimer_setup(&i2c_imx->slave_timer, i2c_imx_slave_timeout, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_ABS);
 
        match = device_get_match_data(&pdev->dev);
        if (match)