i2c: mxc_i2c: Use or operation
authorPeng Fan <peng.fan@nxp.com>
Fri, 29 Dec 2017 07:06:08 +0000 (15:06 +0800)
committerHeiko Schocher <hs@denx.de>
Tue, 16 Jan 2018 05:59:39 +0000 (06:59 +0100)
The operation should be OR, not BIT OR.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
drivers/i2c/mxc_i2c.c

index 205274e9476f86456685cce03e1faf09017743ed..79228c2757bde2944e0e4601374806cace55f179 100644 (file)
@@ -784,9 +784,9 @@ static int mxc_i2c_probe(struct udevice *bus)
                ret2 = gpio_request_by_name_nodev(offset_to_ofnode(node),
                                "sda-gpios", 0, &i2c_bus->sda_gpio,
                                GPIOD_IS_OUT);
-               if (!dm_gpio_is_valid(&i2c_bus->sda_gpio) |
-                   !dm_gpio_is_valid(&i2c_bus->scl_gpio) |
-                   ret | ret2) {
+               if (!dm_gpio_is_valid(&i2c_bus->sda_gpio) ||
+                   !dm_gpio_is_valid(&i2c_bus->scl_gpio) ||
+                   ret || ret2) {
                        dev_err(dev, "i2c bus %d at %lu, fail to request scl/sda gpio\n", bus->seq, i2c_bus->base);
                        return -EINVAL;
                }