[PATCH] i3c: dw: Use more common code in dw_i3c_master_i2c_xfers()

Nuno Sá noname.nuno at gmail.com
Fri Feb 27 08:04:52 PST 2026


On Fri, 2026-02-27 at 11:20 +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring at users.sourceforge.net>
> 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.
> 
> Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
> ---

This actually looks like a fix to me. It's not just reusing common code.

- Nuno Sá

>  drivers/i3c/master/dw-i3c-master.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index d87bde3f7700..beb40d947e6e 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -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
> 



More information about the linux-i3c mailing list