public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP: I2C: Fix omap_register_i2c_bus() return value on success
@ 2011-11-02 11:54 Laurent Pinchart
  2011-11-05  0:19 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Pinchart @ 2011-11-02 11:54 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

Commit 4d17aeb1c5b2375769446d13012a98e6d265ec13 ("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>
---
 arch/arm/plat-omap/i2c.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 3341ca4..443c319 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -165,7 +165,7 @@ static inline int omap2_i2c_add_bus(int bus_id)
 			omap_i2c_latency, ARRAY_SIZE(omap_i2c_latency), 0);
 	WARN(IS_ERR(od), "Could not build omap_device for %s\n", name);
 
-	return PTR_ERR(od);
+	return PTR_RET(od);
 }
 #else
 static inline int omap2_i2c_add_bus(int bus_id)
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-05  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-02 11:54 [PATCH] OMAP: I2C: Fix omap_register_i2c_bus() return value on success Laurent Pinchart
2011-11-05  0:19 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox