Skip to content

Commit 4769dbb

Browse files
jared-kangashenrikbrixandersen
authored andcommitted
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: Jared Kangas <[email protected]> (cherry picked from commit 8ec3c04)
1 parent b27d3a6 commit 4769dbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/adc/adc_lmp90xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ static int lmp90xxx_adc_read_channel(const struct device *dev,
639639
if (buf[3] != crc) {
640640
LOG_ERR("CRC mismatch (0x%02x vs. 0x%02x)", buf[3],
641641
crc);
642-
return err;
642+
return -EIO;
643643
}
644644
}
645645

0 commit comments

Comments
 (0)