devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jon-hunter@ti.com>
To: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Benoit Cousson <b-cousson@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Russell King <linux@arm.linux.org.uk>,
	Enric Balletbo i Serra <eballetbo@gmail.com>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH 1/3] ARM: OMAP2+: return -ENODEV if GPMC child device creation fails
Date: Thu, 14 Mar 2013 13:50:28 -0500	[thread overview]
Message-ID: <51421BF4.3050703@ti.com> (raw)
In-Reply-To: <1363273762-17441-2-git-send-email-javier.martinez@collabora.co.uk>



On 03/14/2013 10:09 AM, Javier Martinez Canillas wrote:
> gpmc_probe_nor_child() calls of_platform_device_create() to create a
> platform device for the NOR child. If this function fails the value
> of ret is returned to the caller but this value is zero since it was
> assigned the return of a previous call to gpmc_cs_program_settings()
> that had to succeed or otherwise gpmc_probe_nor_child() would have
> returned before.
> 
> This means that if of_platform_device_create() fails, 0 will be returned
> to the caller instead of an appropriate error code.
> 
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
>  arch/arm/mach-omap2/gpmc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index d594e1d..8799aed 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -1505,6 +1505,7 @@ static int gpmc_probe_nor_child(struct platform_device *pdev,
>  		return 0;
>  
>  	dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
> +	ret = -ENODEV;
>  
>  err:
>  	gpmc_cs_free(cs);

Good catch! Thanks for the fix, I will pick this up.

Cheers
Jon

  reply	other threads:[~2013-03-14 18:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 15:09 [PATCH 0/3] ARM: OMAP2+: Add GPMC DT support for Ethernet child Javier Martinez Canillas
2013-03-14 15:09 ` [PATCH 1/3] ARM: OMAP2+: return -ENODEV if GPMC child device creation fails Javier Martinez Canillas
2013-03-14 18:50   ` Jon Hunter [this message]
2013-03-14 15:09 ` [PATCH 2/3] ARM: OMAP2+: rename gpmc_probe_nor_child() to gpmc_probe_generic_child() Javier Martinez Canillas
2013-03-14 18:51   ` Jon Hunter
2013-03-14 15:09 ` [PATCH 3/3] ARM: OMAP2+: Add GPMC DT support for Ethernet child nodes Javier Martinez Canillas
2013-03-14 15:48   ` Jon Hunter
2013-03-14 16:37     ` Javier Martinez Canillas
2013-03-14 16:56       ` Javier Martinez Canillas
2013-03-14 18:49       ` Jon Hunter
2013-03-14 20:28         ` Javier Martinez Canillas

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=51421BF4.3050703@ti.com \
    --to=jon-hunter@ti.com \
    --cc=b-cousson@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=eballetbo@gmail.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=grant.likely@secretlab.ca \
    --cc=javier.martinez@collabora.co.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).