]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: accel: adxl380: fix raw sample read
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 1 Nov 2024 09:52:01 +0000 (11:52 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 1 Nov 2024 15:24:01 +0000 (15:24 +0000)
commitbfa335f18d91c52fa0f8ba3e4d49afebbd9ee792
tree0a6a0b52ac7e72fb87ec1f8d887a92a029e6dd9c
parentb7d2bc99b3bdc03fff9b416dd830632346d83530
iio: accel: adxl380: fix raw sample read

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: df36de13677a ("iio: accel: add ADXL380 driver")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://patch.msgid.link/20241101095202.20121-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl380.c