public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Slawomir Stepien <sst@poczta.fm>
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de,
	pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH 1/1] staging: iio: adc: ad7280a: fix overwrite of the returned value
Date: Sun, 2 Dec 2018 15:36:59 +0000	[thread overview]
Message-ID: <20181202153659.1c8eb23c@archlinux> (raw)
In-Reply-To: <20181202114235.12443-1-sst@poczta.fm>

On Sun,  2 Dec 2018 12:42:35 +0100
Slawomir Stepien <sst@poczta.fm> wrote:

> The ret returned from ad7280_chain_setup() is needed to initialize the
> slave_num. Don't overwrite it with call to devm_add_action_or_reset().
> 
> Fixes: cc9c58ef6e06 ("staging: iio: adc: ad7280a: use devm_* APIs")
> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Good find.  Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 7a0ba26f9fd9..14f6a3ced060 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -879,15 +879,15 @@ static int ad7280_probe(struct spi_device *spi)
>  	if (ret < 0)
>  		return ret;
>  
> -	ret = devm_add_action_or_reset(&spi->dev, ad7280_sw_power_down, st);
> -	if (ret)
> -		return ret;
> -
>  	st->slave_num = ret;
>  	st->scan_cnt = (st->slave_num + 1) * AD7280A_NUM_CH;
>  	st->cell_threshhigh = 0xFF;
>  	st->aux_threshhigh = 0xFF;
>  
> +	ret = devm_add_action_or_reset(&spi->dev, ad7280_sw_power_down, st);
> +	if (ret)
> +		return ret;
> +
>  	/*
>  	 * Total Conversion Time = ((tACQ + tCONV) *
>  	 *			   (Number of Conversions per Part)) −


      reply	other threads:[~2018-12-02 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-02 11:42 [PATCH 1/1] staging: iio: adc: ad7280a: fix overwrite of the returned value Slawomir Stepien
2018-12-02 15:36 ` 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=20181202153659.1c8eb23c@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=sst@poczta.fm \
    /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