mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
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>
This commit is contained in:
parent
b002bf5f8d
commit
7fc93f3285
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user