Thread (28 messages) flat view 28 messages, 6 authors, 2026-01-19

Re: [PATCH 02/12] i2c: sun6i-p2wi: use i2c_adapter-specific printk helpers

From: Chen-Yu Tsai <wens@kernel.org>
Date: 2025-12-23 11:04:25
Also in: linux-arm-kernel, linux-i2c, linux-sunxi, lkml

On Tue, Dec 23, 2025 at 6:02 PM Bartosz Golaszewski
[off-list ref] wrote:
Convert all instances of using device printk helpers with struct device
embedded in struct i2c_adapter to the new i2c-specific macros that hide
that dereference.

Signed-off-by: Bartosz Golaszewski <redacted>
Acked-by: Chen-Yu Tsai <wens@kernel.org>
quoted hunk ↗ jump to hunk
---
 drivers/i2c/busses/i2c-sun6i-p2wi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-sun6i-p2wi.c b/drivers/i2c/busses/i2c-sun6i-p2wi.c
index fb5280b8cf7fc0e3cba8ea6a318172ea2b011a02..845ca56cdae2d056c122eb648c082f319d955b5e 100644
--- a/drivers/i2c/busses/i2c-sun6i-p2wi.c
+++ b/drivers/i2c/busses/i2c-sun6i-p2wi.c
@@ -122,7 +122,7 @@ static int p2wi_smbus_xfer(struct i2c_adapter *adap, u16 addr,
        unsigned long dlen = P2WI_DLEN_DATA_LENGTH(1);

        if (p2wi->target_addr >= 0 && addr != p2wi->target_addr) {
-               dev_err(&adap->dev, "invalid P2WI address\n");
+               i2c_err(adap, "invalid P2WI address\n");
                return -EINVAL;
        }
@@ -139,7 +139,7 @@ static int p2wi_smbus_xfer(struct i2c_adapter *adap, u16 addr,
        writel(dlen, p2wi->regs + P2WI_DLEN);

        if (readl(p2wi->regs + P2WI_CTRL) & P2WI_CTRL_START_TRANS) {
-               dev_err(&adap->dev, "P2WI bus busy\n");
+               i2c_err(adap, "P2WI bus busy\n");
                return -EBUSY;
        }
@@ -154,12 +154,12 @@ static int p2wi_smbus_xfer(struct i2c_adapter *adap, u16 addr,
        wait_for_completion(&p2wi->complete);

        if (p2wi->status & P2WI_INTS_LOAD_BSY) {
-               dev_err(&adap->dev, "P2WI bus busy\n");
+               i2c_err(adap, "P2WI bus busy\n");
                return -EBUSY;
        }

        if (p2wi->status & P2WI_INTS_TRANS_ERR) {
-               dev_err(&adap->dev, "P2WI bus xfer error\n");
+               i2c_err(adap, "P2WI bus xfer error\n");
                return -ENXIO;
        }


--
2.47.3
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help