Skip to content

Commit

Permalink
i2c: fix always-true condition in i2c_probe_chip()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]>
  • Loading branch information
nikita-yoush authored and hsdenx committed Mar 23, 2022
1 parent 532a5b2 commit 6db539f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/i2c-uclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6db539f

Please sign in to comment.