mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
i3c: renesas: Return immediately if there is no transfer
There is no need to allocate a transfer structure when i2c_nxfers is zero. Return immediately instead of unnecessarily allocating memory. Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com> Link: https://patch.msgid.link/20260713130545.568657-11-claudiu.beznea+renesas@tuxon.dev Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
35e9bb2be1
commit
33b5ecc5a1
|
|
@ -959,13 +959,13 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
|
|||
u8 start_bit = CNDCTL_STCND;
|
||||
int i;
|
||||
|
||||
if (!i2c_nxfers)
|
||||
return 0;
|
||||
|
||||
struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
|
||||
if (!xfer)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!i2c_nxfers)
|
||||
return 0;
|
||||
|
||||
renesas_i3c_bus_enable(m, false);
|
||||
|
||||
init_completion(&xfer->comp);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user