[tip: timers/cleanups] ASoC: fsl: imx-pcm-fiq: Switch to use hrtimer_setup()

From: tip-bot2 for Nam Cao
Date: Tue Feb 18 2025 - 05:32:19 EST


The following commit has been merged into the timers/cleanups branch of tip:

Commit-ID: ce68de08a2cc95dc2cb6018a22673beed52f25c3
Gitweb: https://git.kernel.org/tip/ce68de08a2cc95dc2cb6018a22673beed52f25c3
Author: Nam Cao <namcao@xxxxxxxxxxxxx>
AuthorDate: Wed, 05 Feb 2025 11:46:32 +01:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitterDate: Tue, 18 Feb 2025 11:19:07 +01:00

ASoC: fsl: imx-pcm-fiq: 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 <namcao@xxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Acked-by: Zack Rusin <zack.rusin@xxxxxxxxxxxx>
Link: https://lore.kernel.org/all/ed4be9ec380a688291e3fc9b24f8c38a3f07a143.1738746904.git.namcao@xxxxxxxxxxxxx

---
sound/soc/fsl/imx-pcm-fiq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 3391430..83de3ae 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -185,8 +185,7 @@ static int snd_imx_open(struct snd_soc_component *component,

atomic_set(&iprtd->playing, 0);
atomic_set(&iprtd->capturing, 0);
- hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- iprtd->hrt.function = snd_hrtimer_callback;
+ hrtimer_setup(&iprtd->hrt, snd_hrtimer_callback, CLOCK_MONOTONIC, HRTIMER_MODE_REL);

ret = snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);