From b22b2064382c4482005d8367e88922ba30f87c04 Mon Sep 17 00:00:00 2001 From: Jay Vasanth Date: Wed, 18 May 2022 15:01:33 -0400 Subject: [PATCH] driver: i2c: MEC15xx: improve debug logging Add extra parameters for logging to improve debugging Signed-off-by: Jay Vasanth --- drivers/i2c/i2c_mchp_xec.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/i2c_mchp_xec.c b/drivers/i2c/i2c_mchp_xec.c index f3f405df4db..3334d44e9e2 100644 --- a/drivers/i2c/i2c_mchp_xec.c +++ b/drivers/i2c/i2c_mchp_xec.c @@ -425,8 +425,8 @@ static int i2c_xec_poll_write(const struct device *dev, struct i2c_msg msg, ret = wait_bus_free(dev); if (ret) { data->error_seen = 1; - LOG_DBG("%s: %s wait_bus_free failure", - __func__, dev->name); + LOG_DBG("%s: %s wait_bus_free failure %d", + __func__, dev->name, ret); return ret; } @@ -450,8 +450,8 @@ static int i2c_xec_poll_write(const struct device *dev, struct i2c_msg msg, default: data->error_seen = 1; - LOG_ERR("%s: %s wait_comp error for addr send", - __func__, dev->name); + LOG_ERR("%s: %s wait_comp error %d for addr send", + __func__, dev->name, ret); return ret; } } @@ -478,8 +478,8 @@ static int i2c_xec_poll_write(const struct device *dev, struct i2c_msg msg, default: data->error_seen = 1; - LOG_ERR("%s: %s wait_completion error for data send", - __func__, dev->name); + LOG_ERR("%s: %s wait_completion error %d for data send", + __func__, dev->name, ret); return ret; } } @@ -560,8 +560,8 @@ static int i2c_xec_poll_read(const struct device *dev, struct i2c_msg msg, ret = wait_bus_free(dev); if (ret) { data->error_seen = 1; - LOG_DBG("%s: %s wait_bus_free failure", - __func__, dev->name); + LOG_DBG("%s: %s wait_bus_free failure %d", + __func__, dev->name, ret); return ret; } } @@ -595,8 +595,8 @@ static int i2c_xec_poll_read(const struct device *dev, struct i2c_msg msg, default: data->error_seen = 1; - LOG_ERR("%s: %s wait_completion error for address send", - __func__, dev->name); + LOG_ERR("%s: %s wait_completion error %d for address send", + __func__, dev->name, ret); return ret; } @@ -628,8 +628,8 @@ static int i2c_xec_poll_read(const struct device *dev, struct i2c_msg msg, default: data->error_seen = 1; - LOG_ERR("%s: %s wait_completion error for data send", - __func__, dev->name); + LOG_ERR("%s: %s wait_completion error %d for data send", + __func__, dev->name, ret); return ret; }