]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: i2c: fix build when CFG_SYS_I2C_NOPROBES defined with DM_I2C
authorHolger Brunck <holger.brunck@hitachienergy.com>
Mon, 14 Jul 2025 11:56:08 +0000 (13:56 +0200)
committerHeiko Schocher <hs@denx.de>
Wed, 16 Jul 2025 07:21:03 +0000 (09:21 +0200)
When DM_I2C is enabled and CFG_SYS_I2C_NOPROBES is defined, the
building is broken due to already existing 'bus' local variable.
Rename udevice 'bus' to 'cur_bus' to fix this.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
cmd/i2c.c

index 7246c4fa3e7c34b56762f8f95f687696404a9f12..f0aae93073fa8129c282dce328d71515f9bb8609 100644 (file)
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -917,9 +917,9 @@ static int do_i2c_probe(struct cmd_tbl *cmdtp, int flag, int argc,
 #endif /* NOPROBES */
        int ret;
 #if CONFIG_IS_ENABLED(DM_I2C)
-       struct udevice *bus, *dev;
+       struct udevice *cur_bus, *dev;
 
-       if (i2c_get_cur_bus(&bus))
+       if (i2c_get_cur_bus(&cur_bus))
                return CMD_RET_FAILURE;
 #endif
 
@@ -943,7 +943,7 @@ static int do_i2c_probe(struct cmd_tbl *cmdtp, int flag, int argc,
                        continue;
 #endif
 #if CONFIG_IS_ENABLED(DM_I2C)
-               ret = dm_i2c_probe(bus, j, 0, &dev);
+               ret = dm_i2c_probe(cur_bus, j, 0, &dev);
 #else
                ret = i2c_probe(j);
 #endif