iio: iio: Fix iio_channel_read return if channel havn't info
authorFabien Proriol <fabien.proriol@jdsu.com>
Thu, 1 Jan 2015 12:46:48 +0000 (12:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:39:14 +0000 (07:39 -0800)
commitb9f07cf22622aaadb4139e5c97f99fef4283a391
tree607ab7a168d4f2c7ee688088a21f616d2ed4936a
parente9c78c887f6f67fe2e11da0bc8ffe91d392b460f
iio: iio: Fix iio_channel_read return if channel havn't info

[ Upstream commit 65de7654d39c70c2b942f801cea01590cf7e3458 ]

When xilinx-xadc is used with hwmon driver to read voltage, offset used
for temperature is always applied whatever the channel.

iio_channel_read must return an error to avoid offset for channel
without IIO_CHAN_INFO_OFFSET property.

Signed-off-by: Fabien Proriol <fabien.proriol@jdsu.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/inkern.c