diff mbox series

[U-Boot] i2c: mxc_i2c: Use or operation

Message ID 1514531168-18923-1-git-send-email-peng.fan@nxp.com
State Accepted
Commit fb0128736b7bfb83b43a35211f603c74f8627eff
Delegated to: Heiko Schocher
Headers show
Series [U-Boot] i2c: mxc_i2c: Use or operation | expand

Commit Message

Peng Fan Dec. 29, 2017, 7:06 a.m. UTC
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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Heiko Schocher Jan. 16, 2018, 9:50 a.m. UTC | #1
Hello Peng,

Am 29.12.2017 um 08:06 schrieb Peng Fan:
> 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 | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-i2c.git master

Thanks!

bye,
Heiko
diff mbox series

Patch

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 205274e..79228c2 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -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;
 		}