]> git.baikalelectronics.ru Git - uboot.git/commitdiff
i2c: fix always-true condition in i2c_probe_chip()
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>
Tue, 15 Feb 2022 17:58:52 +0000 (20:58 +0300)
committerHeiko Schocher <hs@denx.de>
Wed, 23 Mar 2022 06:27:37 +0000 (07:27 +0100)
Per dm_i2c_ops.probe_chip documentation, i2c_probe_chip() shall fallback
to default probe method when .probe_chip() returns -ENOSYS.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
drivers/i2c/i2c-uclass.c

index 5539becc197e4f1430d026f080ad48baa953f427..335911c46bb58524c8b58485a0e3029d82540941 100644 (file)
@@ -280,7 +280,7 @@ static int i2c_probe_chip(struct udevice *bus, uint chip_addr,
 
        if (ops->probe_chip) {
                ret = ops->probe_chip(bus, chip_addr, chip_flags);
-               if (!ret || ret != -ENOSYS)
+               if (ret != -ENOSYS)
                        return ret;
        }