diff options
author | Aditya Pakki <pakki001@umn.edu> | 2018-12-27 20:54:52 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-01-05 17:44:02 +0100 |
commit | 7fc93f3285b17f4632694efce5ff0160303388a8 (patch) | |
tree | fc34f22be0fa8614ef88cd758a2b84903890663e /drivers/iio | |
parent | iio: adc: meson-saradc: enable the temperature sensor two more SoCs (diff) | |
download | linux-7fc93f3285b17f4632694efce5ff0160303388a8.tar.xz linux-7fc93f3285b17f4632694efce5ff0160303388a8.zip |
iio: adc: xilinx: check return value of xadc_write_adc_reg
In function xadc_probe, xadc_write_adc_reg can return an error value
when write fails. The fix checks for the return value consistent with
other invocations of the latter function.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/adc/xilinx-xadc-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 3f6be5ac049a..b13c61539d46 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1273,8 +1273,10 @@ static int xadc_probe(struct platform_device *pdev) xadc->threshold[i] = 0xffff; else xadc->threshold[i] = 0; - xadc_write_adc_reg(xadc, XADC_REG_THRESHOLD(i), + ret = xadc_write_adc_reg(xadc, XADC_REG_THRESHOLD(i), xadc->threshold[i]); + if (ret) + goto err_free_irq; } /* Go to non-buffered mode */ |