]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ti: i2c: fix probe_chip() return value
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>
Tue, 15 Feb 2022 18:10:09 +0000 (21:10 +0300)
committerTom Rini <trini@konsulko.com>
Mon, 21 Feb 2022 13:39:52 +0000 (08:39 -0500)
Per documentation, dm_i2c_ops.probe_chip() shall return -EREMOTEIO if
probe fails.

Currently, omap_i2c_probe_chip() returns 1 instead. Fix that.

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

index a767dee9866c8258114ee8df0377bccacec4e2df..c656cf8b7a136d0febc5af8147ccc251b0773f57 100644 (file)
@@ -1015,7 +1015,7 @@ static int omap_i2c_probe_chip(struct udevice *bus, uint chip_addr,
        struct omap_i2c *priv = dev_get_priv(bus);
 
        return __omap24_i2c_probe(priv->regs, priv->ip_rev, priv->waitdelay,
-                                 chip_addr);
+                                 chip_addr) ? -EREMOTEIO : 0;
 }
 
 static int omap_i2c_probe(struct udevice *bus)