Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Nuno Sá" <nuno.sa@analog.com>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio: adc: max1027: unlock on error path in max1027_read_single_value()
Date: Sat, 16 Jul 2022 18:54:27 +0100	[thread overview]
Message-ID: <20220716185427.21f2d660@jic23-huawei> (raw)
In-Reply-To: <YsbztVuAXnau2cIZ@kili>

On Thu, 7 Jul 2022 17:54:45 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> If max1027_wait_eoc() fails then call iio_device_release_direct_mode()
> before returning.
> 
> Fixes: a0e831653ef9 ("iio: adc: max1027: Introduce an end of conversion helper")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Queued up on a special
fixes-togreg-post-5.20-rc1 branch in iio.git as I don't think I'll get another
pull request out for this in time to intercept the merge window.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/max1027.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> index b725d012625c..136fcf753837 100644
> --- a/drivers/iio/adc/max1027.c
> +++ b/drivers/iio/adc/max1027.c
> @@ -349,8 +349,7 @@ static int max1027_read_single_value(struct iio_dev *indio_dev,
>  	if (ret < 0) {
>  		dev_err(&indio_dev->dev,
>  			"Failed to configure conversion register\n");
> -		iio_device_release_direct_mode(indio_dev);
> -		return ret;
> +		goto release;
>  	}
>  
>  	/*
> @@ -360,11 +359,12 @@ static int max1027_read_single_value(struct iio_dev *indio_dev,
>  	 */
>  	ret = max1027_wait_eoc(indio_dev);
>  	if (ret)
> -		return ret;
> +		goto release;
>  
>  	/* Read result */
>  	ret = spi_read(st->spi, st->buffer, (chan->type == IIO_TEMP) ? 4 : 2);
>  
> +release:
>  	iio_device_release_direct_mode(indio_dev);
>  
>  	if (ret < 0)


      reply	other threads:[~2022-07-16 17:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 14:54 [PATCH] iio: adc: max1027: unlock on error path in max1027_read_single_value() Dan Carpenter
2022-07-16 17:54 ` Jonathan Cameron [this message]

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=20220716185427.21f2d660@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=nuno.sa@analog.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