[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200516182044.373adf4b@archlinux>
Date: Sat, 16 May 2020 18:20:44 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Alexandru Ardelean <alexandru.ardelean@...log.com>
Cc: <linux-iio@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-kernel@...r.kernel.org>, <ludovic.desroches@...rochip.com>,
<eugen.hristev@...rochip.com>, <nicolas.ferre@...rochip.com>,
<alexandre.belloni@...tlin.com>, <alexandre.torgue@...com>,
<mcoquelin.stm32@...il.com>, <ak@...klinger.de>
Subject: Re: [PATCH v2 4/8] iio: stm32-dfsdm-adc: pass iio device as arg for
the interrupt handler
On Thu, 14 May 2020 16:17:06 +0300
Alexandru Ardelean <alexandru.ardelean@...log.com> wrote:
> This changes the argument for the interrupt handler to be the IIO device
> instead of the state-struct.
> Since there will be some changes to how iio_priv_to_dev() is implemented,
> it could be that the helper becomes a bit slower, as it will be hidden away
> in the IIO core.
>
> The iio_priv() call will still be fast enough, as it will return a void
> pointer from the public IIO device structure. So it's better to switch the
> order.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.com>
Whilst this one looks fine to me. I'd definitely like an Ack from
one of the stm people in case I'm missing something.
> ---
> drivers/iio/adc/stm32-dfsdm-adc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
> index 76a60d93fe23..28ef02887bd3 100644
> --- a/drivers/iio/adc/stm32-dfsdm-adc.c
> +++ b/drivers/iio/adc/stm32-dfsdm-adc.c
> @@ -1313,8 +1313,8 @@ static const struct iio_info stm32_dfsdm_info_adc = {
>
> static irqreturn_t stm32_dfsdm_irq(int irq, void *arg)
> {
> - struct stm32_dfsdm_adc *adc = arg;
> - struct iio_dev *indio_dev = iio_priv_to_dev(adc);
> + struct iio_dev *indio_dev = arg;
> + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
> struct regmap *regmap = adc->dfsdm->regmap;
> unsigned int status, int_en;
>
> @@ -1603,7 +1603,7 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
> return irq;
>
> ret = devm_request_irq(dev, irq, stm32_dfsdm_irq,
> - 0, pdev->name, adc);
> + 0, pdev->name, iio);
> if (ret < 0) {
> dev_err(dev, "Failed to request IRQ\n");
> return ret;
Powered by blists - more mailing lists