Commit 7fc93f32 authored by Aditya Pakki's avatar Aditya Pakki Committed by Jonathan Cameron

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: default avatarAditya Pakki <pakki001@umn.edu>
Reviewed-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent b002bf5f
...@@ -1273,8 +1273,10 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1273,8 +1273,10 @@ static int xadc_probe(struct platform_device *pdev)
xadc->threshold[i] = 0xffff; xadc->threshold[i] = 0xffff;
else else
xadc->threshold[i] = 0; 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]); xadc->threshold[i]);
if (ret)
goto err_free_irq;
} }
/* Go to non-buffered mode */ /* Go to non-buffered mode */
......
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