iio: adc: at91: signedness bug in at91_adc_get_trigger_value_by_name()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 6 Nov 2014 09:13:00 +0000 (09:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jun 2014 19:12:41 +0000 (15:12 -0400)
commit9e655732466125a675a3bb8b0ebedfc921dfdcd5
treef4b7780b7257f8f35d735886f0a2b419672582c3
parent3605c64ece931ac1b5e921068d47a54874b961c8
iio: adc: at91: signedness bug in at91_adc_get_trigger_value_by_name()

commit 4f3bcd878f1d3c730fe00f619b7260c6125d49eb upstream.

at91_adc_get_trigger_value_by_name() was returning -ENOMEM truncated to
a positive u8 and that doesn't work.  I've changed it to int and
refactored it to preserve the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/at91_adc.c