From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Nam Cao <namcao@linutronix.de>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
<linux-kernel@vger.kernel.org>,
Zack Rusin <zack.rusin@broadcom.com>, <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2 27/45] iio: Switch to use hrtimer_setup()
Date: Wed, 5 Feb 2025 16:21:37 +0000 [thread overview]
Message-ID: <20250205162137.0000404c@huawei.com> (raw)
In-Reply-To: <570792e31b28a94a511c19c6789f2171a6745685.1738746904.git.namcao@linutronix.de>
On Wed, 5 Feb 2025 11:46:15 +0100
Nam Cao <namcao@linutronix.de> 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: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Acked-by: Zack Rusin <zack.rusin@broadcom.com>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
+CC linux-iio
> ---
> drivers/iio/adc/ti-tsc2046.c | 4 +---
> drivers/iio/trigger/iio-trig-hrtimer.c | 4 ++--
> 2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
> index 7dde5713973f..49560059f4b7 100644
> --- a/drivers/iio/adc/ti-tsc2046.c
> +++ b/drivers/iio/adc/ti-tsc2046.c
> @@ -812,9 +812,7 @@ static int tsc2046_adc_probe(struct spi_device *spi)
>
> spin_lock_init(&priv->state_lock);
> priv->state = TSC2046_STATE_SHUTDOWN;
> - hrtimer_init(&priv->trig_timer, CLOCK_MONOTONIC,
> - HRTIMER_MODE_REL_SOFT);
> - priv->trig_timer.function = tsc2046_adc_timer;
> + hrtimer_setup(&priv->trig_timer, tsc2046_adc_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
>
> ret = devm_iio_trigger_register(dev, trig);
> if (ret) {
> diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c
> index 716c795d08fb..82c72baccb62 100644
> --- a/drivers/iio/trigger/iio-trig-hrtimer.c
> +++ b/drivers/iio/trigger/iio-trig-hrtimer.c
> @@ -145,8 +145,8 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name)
> trig_info->swt.trigger->ops = &iio_hrtimer_trigger_ops;
> trig_info->swt.trigger->dev.groups = iio_hrtimer_attr_groups;
>
> - hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
> - trig_info->timer.function = iio_hrtimer_trig_handler;
> + hrtimer_setup(&trig_info->timer, iio_hrtimer_trig_handler, CLOCK_MONOTONIC,
> + HRTIMER_MODE_REL_HARD);
>
> trig_info->sampling_frequency[0] = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;
> trig_info->period = NSEC_PER_SEC / trig_info->sampling_frequency[0];
parent reply other threads:[~2025-02-05 16:21 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <570792e31b28a94a511c19c6789f2171a6745685.1738746904.git.namcao@linutronix.de>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250205162137.0000404c@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namcao@linutronix.de \
--cc=tglx@linutronix.de \
--cc=zack.rusin@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox