Skip to content

Commit

Permalink
ARM: OMAP: I2C: Fix omap_register_i2c_bus() return value on success
Browse files Browse the repository at this point in the history
Commit 4d17aeb ("OMAP: I2C: split
device registration and convert OMAP2+ to omap_device") makes
omap2_i2c_add_bus() return a pointer to an omap_device instead on
success instead of 0.

This breaks the omap_register_i2c_bus() ABI and results in the igep0020
board code detecting an I2C bus registration error when there is none.

Fix the problem by using PTR_RET() instead of PTR_ERR() in
omap2_i2c_add_bus().

Reported-by: Alexander Kinzer <a.kinzer@plusoptix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[tony@atomide.com: updated to return pdev instead of od]
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Laurent Pinchart authored and Tony Lindgren committed Nov 5, 2011
1 parent 869dec1 commit af504e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/plat-omap/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static inline int omap2_i2c_add_bus(int bus_id)
NULL, 0, 0);
WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);

return PTR_ERR(pdev);
return PTR_RET(pdev);
}
#else
static inline int omap2_i2c_add_bus(int bus_id)
Expand Down

0 comments on commit af504e5

Please sign in to comment.