Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: ad7606: Fix incorrect type for error return variable

The variable ret is declared as unsigned int but is used to store return
values from functions returning int, which may be negative error codes.

Change ret from unsigned int to int.

Fixes: 849cebf8dc67 ("iio: adc: ad7606: Add iio-backend support")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Haotian Zhang and committed by
Jonathan Cameron
c5512e01 6b39824a

+2 -1
+2 -1
drivers/iio/adc/ad7606_par.c
··· 43 43 struct iio_dev *indio_dev) 44 44 { 45 45 struct ad7606_state *st = iio_priv(indio_dev); 46 - unsigned int ret, c; 46 + unsigned int c; 47 + int ret; 47 48 struct iio_backend_data_fmt data = { 48 49 .sign_extend = true, 49 50 .enable = true,