aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome/cros_ec_lpc_mec.h
diff options
context:
space:
mode:
authorBen Walsh <ben@jubnut.com>2024-06-05 07:33:47 +0100
committerTzung-Bi Shih <tzungbi@kernel.org>2024-06-06 03:09:16 +0000
commit68dbac0a58ef7d82bc78dcb7e5ab5db2c6dfb489 (patch)
treef23a1efdb38df578e9f08c276bd07911fc2d034b /drivers/platform/chrome/cros_ec_lpc_mec.h
parentplatform/chrome: cros_ec_proto: Upgrade get_next_event to v3 (diff)
downloadlinux-68dbac0a58ef7d82bc78dcb7e5ab5db2c6dfb489.tar.gz
linux-68dbac0a58ef7d82bc78dcb7e5ab5db2c6dfb489.zip
platform/chrome: cros_ec_lpc: MEC access can return error code
cros_ec_lpc_io_bytes_mec was returning a u8 checksum of all bytes read/written, which didn't leave room to indicate errors. Change this u8 to an int where negative values indicate an error, and non-negative values are the checksum as before. Tested-by: Dustin L. Howett <dustin@howett.net> Signed-off-by: Ben Walsh <ben@jubnut.com> Link: https://lore.kernel.org/r/20240605063351.14836-2-ben@jubnut.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'drivers/platform/chrome/cros_ec_lpc_mec.h')
-rw-r--r--drivers/platform/chrome/cros_ec_lpc_mec.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.h b/drivers/platform/chrome/cros_ec_lpc_mec.h
index 9d0521b23e8a..69670832f187 100644
--- a/drivers/platform/chrome/cros_ec_lpc_mec.h
+++ b/drivers/platform/chrome/cros_ec_lpc_mec.h
@@ -64,9 +64,10 @@ int cros_ec_lpc_mec_in_range(unsigned int offset, unsigned int length);
* @length: Number of bytes to read / write
* @buf: Destination / source buffer
*
- * @return 8-bit checksum of all bytes read / written
+ * @return: A negative error code on error, or 8-bit checksum of all
+ * bytes read / written
*/
-u8 cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type,
- unsigned int offset, unsigned int length, u8 *buf);
+int cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type,
+ unsigned int offset, unsigned int length, u8 *buf);
#endif /* __CROS_EC_LPC_MEC_H */