Commit 794e20ee authored by Slawomir Stepien's avatar Slawomir Stepien Committed by Jonathan Cameron

staging: iio: adc: ad7280a: fix overwrite of the returned value

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: cc9c58ef ("staging: iio: adc: ad7280a: use devm_* APIs")
Signed-off-by: default avatarSlawomir Stepien <sst@poczta.fm>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 53e8785c
...@@ -879,15 +879,15 @@ static int ad7280_probe(struct spi_device *spi) ...@@ -879,15 +879,15 @@ static int ad7280_probe(struct spi_device *spi)
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = devm_add_action_or_reset(&spi->dev, ad7280_sw_power_down, st);
if (ret)
return ret;
st->slave_num = ret; st->slave_num = ret;
st->scan_cnt = (st->slave_num + 1) * AD7280A_NUM_CH; st->scan_cnt = (st->slave_num + 1) * AD7280A_NUM_CH;
st->cell_threshhigh = 0xFF; st->cell_threshhigh = 0xFF;
st->aux_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) * * Total Conversion Time = ((tACQ + tCONV) *
* (Number of Conversions per Part)) − * (Number of Conversions per Part)) −
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment