Skip to content
Snippets Groups Projects
Commit c41dba28 authored by Antoniu Miclaus's avatar Antoniu Miclaus Committed by Greg Kroah-Hartman
Browse files

iio: accel: adxl380: fix raw sample read


[ Upstream commit bfa335f18d91c52fa0f8ba3e4d49afebbd9ee792 ]

The adxl380_read_chn function returns either a negative value in case an
error occurs or the actual sample.

Check only for negative values after a channel is read.

Fixes: df36de13 ("iio: accel: add ADXL380 driver")
Signed-off-by: default avatarAntoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://patch.msgid.link/20241101095202.20121-1-antoniu.miclaus@analog.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ab90d20d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment