]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
i2c: iproc: When there's an error treat it as an error
authorAndi Shyti <andi.shyti@kernel.org>
Fri, 18 Apr 2025 21:16:34 +0000 (23:16 +0200)
committerAndi Shyti <andi@smida.it>
Mon, 19 May 2025 20:23:56 +0000 (22:23 +0200)
If the xfer fails, it indicates a real error. Log it with an
error message instead of a debug message to reflect its severity.

Link: https://lore.kernel.org/r/20250418211635.2666234-10-andi.shyti@kernel.org
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-bcm-iproc.c

index 4553225d7cdd53b240f92ba421a749146835c3f8..bd8233ebf6fc17680c40ebb4828eff6e4afaa401 100644 (file)
@@ -728,31 +728,31 @@ static int bcm_iproc_i2c_check_status(struct bcm_iproc_i2c_dev *iproc_i2c,
                return 0;
 
        case M_CMD_STATUS_LOST_ARB:
-               dev_dbg(iproc_i2c->device, "lost bus arbitration\n");
+               dev_err(iproc_i2c->device, "lost bus arbitration\n");
                return -EAGAIN;
 
        case M_CMD_STATUS_NACK_ADDR:
-               dev_dbg(iproc_i2c->device, "NAK addr:0x%02x\n", msg->addr);
+               dev_err(iproc_i2c->device, "NAK addr:0x%02x\n", msg->addr);
                return -ENXIO;
 
        case M_CMD_STATUS_NACK_DATA:
-               dev_dbg(iproc_i2c->device, "NAK data\n");
+               dev_err(iproc_i2c->device, "NAK data\n");
                return -ENXIO;
 
        case M_CMD_STATUS_TIMEOUT:
-               dev_dbg(iproc_i2c->device, "bus timeout\n");
+               dev_err(iproc_i2c->device, "bus timeout\n");
                return -ETIMEDOUT;
 
        case M_CMD_STATUS_FIFO_UNDERRUN:
-               dev_dbg(iproc_i2c->device, "FIFO under-run\n");
+               dev_err(iproc_i2c->device, "FIFO under-run\n");
                return -ENXIO;
 
        case M_CMD_STATUS_RX_FIFO_FULL:
-               dev_dbg(iproc_i2c->device, "RX FIFO full\n");
+               dev_err(iproc_i2c->device, "RX FIFO full\n");
                return -ETIMEDOUT;
 
        default:
-               dev_dbg(iproc_i2c->device, "unknown error code=%d\n", val);
+               dev_err(iproc_i2c->device, "unknown error code=%d\n", val);
 
                /* re-initialize i2c for recovery */
                bcm_iproc_i2c_enable_disable(iproc_i2c, false);
@@ -964,7 +964,7 @@ static int bcm_iproc_i2c_xfer(struct i2c_adapter *adapter,
 
        ret = bcm_iproc_i2c_xfer_internal(iproc_i2c, msgs, process_call);
        if (ret) {
-               dev_dbg(iproc_i2c->device, "xfer failed\n");
+               dev_err(iproc_i2c->device, "xfer failed\n");
                return ret;
        }