From: Tony Lindgren <tony@atomide.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] OMAP: I2C: Fix omap_register_i2c_bus() return value on success
Date: Fri, 4 Nov 2011 17:19:38 -0700 [thread overview]
Message-ID: <20111105001937.GL31337@atomide.com> (raw)
In-Reply-To: <1320234843-29115-1-git-send-email-laurent.pinchart@ideasonboard.com>
* Laurent Pinchart <laurent.pinchart@ideasonboard.com> [111102 04:19]:
> --- 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)
Thanks applying into fixes after updating it to return pdev instead
of od as below.
Tony
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Wed, 2 Nov 2011 12:54:03 +0100
Subject: [PATCH] ARM: OMAP: I2C: Fix omap_register_i2c_bus() return value on success
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>
[tony@atomide.com: updated to return pdev instead of od]
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -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)
prev parent reply other threads:[~2011-11-05 0:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111105001937.GL31337@atomide.com \
--to=tony@atomide.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox