i2c: rcar_iic: Do not use unitialised variable

In rcar_iic_xfer if nmsgs == 0 the ret will not be assigned to. As ret
will always be 0 if the for loop is entered, may as well just return 0.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
This commit is contained in:
Andrew Goodbody
2025-07-28 16:04:43 +01:00
committed by Marek Vasut
parent 4ef864f1ae
commit 78b2d408fb

View File

@@ -191,7 +191,7 @@ static int rcar_iic_xfer(struct udevice *dev, struct i2c_msg *msg, int nmsgs)
return -EREMOTEIO;
}
return ret;
return 0;
}
static int rcar_iic_set_speed(struct udevice *dev, uint speed)