Skip to content

Commit

Permalink
drivers: adc: lmp90xxx: fix checksum mismatch return value
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jared-kangas authored and github-actions[bot] committed Jul 3, 2024
1 parent aa96c4d commit 089a8f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/adc/adc_lmp90xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 089a8f6

Please sign in to comment.