1 From 25b4bd6894bf79b5d6150d66222d63afea32f24f Mon Sep 17 00:00:00 2001
2 From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
3 Date: Sun, 16 Oct 2022 09:15:06 +0300
4 Subject: [PATCH] media: i2c: imx290: Print error code when I2C
7 Upstream commit fbe0a89dc7e3.
9 Knowing why I2C transfers fail is useful for debugging. Extend the error
10 message to print the error code.
12 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
13 Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
14 Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
16 drivers/media/i2c/imx290.c | 6 ++++--
17 1 file changed, 4 insertions(+), 2 deletions(-)
19 --- a/drivers/media/i2c/imx290.c
20 +++ b/drivers/media/i2c/imx290.c
21 @@ -370,7 +370,8 @@ static inline int __always_unused imx290
23 ret = regmap_read(imx290->regmap, addr, ®val);
25 - dev_err(imx290->dev, "I2C read failed for addr: %x\n", addr);
26 + dev_err(imx290->dev, "Failed to read register 0x%04x: %d\n",
31 @@ -385,7 +386,8 @@ static int imx290_write_reg(struct imx29
33 ret = regmap_write(imx290->regmap, addr, value);
35 - dev_err(imx290->dev, "I2C write failed for addr: %x\n", addr);
36 + dev_err(imx290->dev, "Failed to write register 0x%04x: %d\n",