From 2be2fa8bd618f616f0b6aea8ecb22249766e52ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Fri, 3 Mar 2023 10:18:59 +0100 Subject: [PATCH] i2c: shell: Fix shell error output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The i2c shell write command outputs the error "Failed to read from device" while it tries to write data to device. This fixes the error by outputting "Failed to write to device" instead. Fixes: uart:~$ i2c write i2c@3ff53000 23 01 Failed to read from device: 23 Signed-off-by: Gaƫl PORTAY --- drivers/i2c/i2c_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c_shell.c b/drivers/i2c/i2c_shell.c index 10250a75e38..4bbefcc5734 100644 --- a/drivers/i2c/i2c_shell.c +++ b/drivers/i2c/i2c_shell.c @@ -163,7 +163,7 @@ static int i2c_write_from_buffer(const struct shell *shell_ctx, buf + MAX_BYTES_FOR_REGISTER_INDEX - reg_addr_bytes, reg_addr_bytes + data_length, dev_addr); if (ret < 0) { - shell_error(shell_ctx, "Failed to read from device: %s", + shell_error(shell_ctx, "Failed to write to device: %s", s_dev_addr); return -EIO; }