Commit 8ec3c045 authored by Jared Kangas's avatar Jared Kangas Committed by Alberto Escolar
Browse files

drivers: adc: lmp90xxx: fix checksum mismatch return value

During channel reads, zero is returned on CRC mismatches: the returned
error variable is not written to after a previous non-zero check. Return
-EIO to mirror other drivers' checksum validation behaviors.

Signed-off-by: default avatarJared Kangas <kangas.jd@gmail.com>
parent b413b505
Loading
Loading
Loading
Loading
+1 −1
Changes for drivers/adc/adc_lmp90xxx.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -639,7 +639,7 @@ static int lmp90xxx_adc_read_channel(const struct device *dev,
		if (buf[3] != crc) {
			LOG_ERR("CRC mismatch (0x%02x vs. 0x%02x)", buf[3],
				crc);
			return err;
			return -EIO;
		}
	}