diff options
author | Diana Z <dzigterman@chromium.org> | 2022-03-31 10:28:15 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-01 22:23:52 +0000 |
commit | b21c71487dd251e118db07ba9ecf3993462ee3f6 (patch) | |
tree | 7f0360e6867781cef9fe05ca9c71a7f1b6eb573d /common/i2c_controller.c | |
parent | 2adf42dee52cd616f2d7de99c924e7aa66f20608 (diff) | |
download | chrome-ec-b21c71487dd251e118db07ba9ecf3993462ee3f6.tar.gz |
I2C trace: Add error prints to trace results
Add printing of error conditions to the i2ctrace results. Otherwise, we
may blindly print the target's data which has not actually been
populated with valid results.
BRANCH=None
BUG=b:221286700
TEST=on nipperkin, write to a nonexistent i2c device and verify the
trace shows an error instead of junk read data:
22-03-31 13:50:24.711 > i2cxfer r 8 0x49 0x00
22-03-31 13:50:29.960 i2c: 8:0x49 wr 0x00 error: 1
22-03-31 13:50:29.963 Unknown error
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ie268ead6b733499c5f5e79afa70d10d834e7898f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3564798
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Feels: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/i2c_controller.c')
-rw-r--r-- | common/i2c_controller.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/i2c_controller.c b/common/i2c_controller.c index d1a14cb11d..5064deb073 100644 --- a/common/i2c_controller.c +++ b/common/i2c_controller.c @@ -168,7 +168,7 @@ __maybe_unused static int chip_i2c_xfer_with_notify( if (IS_ENABLED(CONFIG_I2C_DEBUG)) { i2c_trace_notify(port, addr_flags, out, out_size, - in, in_size); + in, in_size, ret); } return ret; @@ -282,7 +282,7 @@ int i2c_xfer_unlocked(const int port, if (IS_ENABLED(CONFIG_I2C_DEBUG)) { i2c_trace_notify(port, addr_flags, out, out_size, - in, in_size); + in, in_size, ret); } switch (ret) { |