devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandru Ardelean <ardeleanalex@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio <linux-iio@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 1/3] iio:adc:ad7476: Fix remove handling
Date: Fri, 2 Apr 2021 10:34:42 +0300	[thread overview]
Message-ID: <CA+U=DspFppB_cnufH6VLULKCaVQ796GsNykt90OJPPj_ThcyvQ@mail.gmail.com> (raw)
In-Reply-To: <20210401171759.318140-2-jic23@kernel.org>

On Thu, Apr 1, 2021 at 8:47 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This driver was in an odd half way state between devm based cleanup
> and manual cleanup (most of which was missing).
> I would guess something went wrong with a rebase or similar.
> Anyhow, this basially finishes the job as a precusor to improving

2 typos in this commit description

> the regulator handling.
>

I was pretty surprised about this patch [before reading through it].
Anyhow:

Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Fixes: 4bb2b8f94ace3 ("iio: adc: ad7476: implement devm_add_action_or_reset")
> Cc: Michael Hennerich <michael.hennerich@analog.com>
> ---
>  drivers/iio/adc/ad7476.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c
> index 17402714b387..9e9ff07cf972 100644
> --- a/drivers/iio/adc/ad7476.c
> +++ b/drivers/iio/adc/ad7476.c
> @@ -321,25 +321,15 @@ static int ad7476_probe(struct spi_device *spi)
>         spi_message_init(&st->msg);
>         spi_message_add_tail(&st->xfer, &st->msg);
>
> -       ret = iio_triggered_buffer_setup(indio_dev, NULL,
> -                       &ad7476_trigger_handler, NULL);
> +       ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL,
> +                                             &ad7476_trigger_handler, NULL);
>         if (ret)
> -               goto error_disable_reg;
> +               return ret;
>
>         if (st->chip_info->reset)
>                 st->chip_info->reset(st);
>
> -       ret = iio_device_register(indio_dev);
> -       if (ret)
> -               goto error_ring_unregister;
> -       return 0;
> -
> -error_ring_unregister:
> -       iio_triggered_buffer_cleanup(indio_dev);
> -error_disable_reg:
> -       regulator_disable(st->reg);
> -
> -       return ret;
> +       return devm_iio_device_register(&spi->dev, indio_dev);
>  }
>
>  static const struct spi_device_id ad7476_id[] = {
> --
> 2.31.1
>

  reply	other threads:[~2021-04-02  7:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 17:17 [PATCH 0/3] iio:adc:ad7476: Fix, regulator support and binding doc Jonathan Cameron
2021-04-01 17:17 ` [PATCH 1/3] iio:adc:ad7476: Fix remove handling Jonathan Cameron
2021-04-02  7:34   ` Alexandru Ardelean [this message]
2021-04-05 15:01     ` Jonathan Cameron
2021-04-01 17:17 ` [PATCH 2/3] iio:adc:ad7476: Handle the different regulators used by various parts Jonathan Cameron
2021-04-02  8:35   ` Lars-Peter Clausen
2021-04-05 16:02     ` Jonathan Cameron
2021-04-01 17:17 ` [PATCH 3/3] dt-bindings:iio:adc:adi,ad7474: Add missing binding document Jonathan Cameron

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='CA+U=DspFppB_cnufH6VLULKCaVQ796GsNykt90OJPPj_ThcyvQ@mail.gmail.com' \
    --to=ardeleanalex@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).