i3c: dw: Use more common code in dw_i3c_master_i2c_xfers()
Subsystems (2)
PATCH 1/1 i3c: dw: Use more common code in dw_i3c_master_i2c_xfers()
From: Markus Elfring <[email protected]>
Date: Fri, 27 Feb 2026 10:16:50 +0100
Use an additional label so that a bit of common code can be better reused at the end of this function implementation.
--- drivers/i3c/master/dw-i3c-master.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/i3c/master/dw-i3c-master.c +3 -4
@@ -1113,8 +1113,7 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,dev_err (master->dev,"<%s> cannot resume i3c bus master, err: %d\n" , __func__, ret); -dw_i3c_master_free_xfer (xfer); -return ret; + goto free_xfer; }for (i =0 ; i < i2c_nxfers; i++) {
@@ -1144,10 +1143,10 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,if (!wait_for_completion_timeout (&xfer->comp, m->i2c.timeout))dw_i3c_master_dequeue_xfer (master, xfer); +pm_runtime_put_autosuspend (master->dev); ret = xfer->ret; +free_xfer:dw_i3c_master_free_xfer (xfer); - -pm_runtime_put_autosuspend (master->dev);return ret; }
Signature · 7 lines
2.53.0 -- linux-i3c mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-i3c
Quoted 8 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 27 Feb 2026 10:16:50 +0100Use an additional label so that a bit of common code can be better reused at the end of this function implementation.
Signed-off-by Markus Elfring <[email protected]>---
Quoted 33 lines
drivers/i3c/master/dw-i3c-master.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/i3c/master/dw-i3c-master.c +3
-5@@ -1113,8 +1113,7 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,dev_err (master->dev,"<%s> cannot resume i3c bus master, err: %d\n" , __func__, ret); -dw_i3c_master_free_xfer (xfer); -return ret; + goto free_xfer; }for (i =0 ; i < i2c_nxfers; i++) {@@ -1144,10 +1143,10 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,if (!wait_for_completion_timeout (&xfer->comp, m->i2c.timeout))dw_i3c_master_dequeue_xfer (master, xfer); +pm_runtime_put_autosuspend (master->dev); ret = xfer->ret; +free_xfer:dw_i3c_master_free_xfer (xfer); - -pm_runtime_put_autosuspend (master->dev);return ret; } --2.53.0
Quoted 8 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 27 Feb 2026 10:16:50 +0100Use an additional label so that a bit of common code can be better reused at the end of this function implementation.
Signed-off-by Markus Elfring <[email protected]>---
This actually looks like a fix to me. It's not just reusing common code.
- Nuno Sá
Quoted 33 lines
drivers/i3c/master/dw-i3c-master.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)drivers/i3c/master/dw-i3c-master.c +1
-2@@ -1113,8 +1113,7 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev, dev_err(master->dev, "<%s> cannot resume i3c bus master, err: %d\n", __func__, ret); -dw_i3c_master_free_xfer (xfer); -return ret; + goto free_xfer; }
for (i = 0; i <i2c_nxfers; i++) {drivers/i3c/master/dw-i3c-master.c +0
-0@@ -1144,10 +1143,10 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev, if (!wait_for_completion_timeout(&xfer->comp, m->i2c.timeout)) dw_i3c_master_dequeue_xfer(master, xfer);drivers/i3c/master/dw-i3c-master.c +1
-0+pm_runtime_put_autosuspend (master->dev);ret =
xfer->ret;
+free_xfer:
dw_i3c_master_free_xfer(xfer);drivers/i3c/master/dw-i3c-master.c +0
-2- -pm_runtime_put_autosuspend (master->dev);return ret;
}Signature · 1 line
2.53.0