linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] arm: omap3: pm34xx.c: Fix omap3_pm_init() error out paths
Date: Mon, 19 Mar 2012 11:48:45 +0200	[thread overview]
Message-ID: <1332150525.2116.334.camel@sokoban> (raw)
In-Reply-To: <1332033768-21986-2-git-send-email-mgreer@animalcreek.com>

On Sat, 2012-03-17 at 18:22 -0700, Mark A. Greer wrote:
> From: "Mark A. Greer" <mgreer@animalcreek.com>
> 
> It appears that the error paths were overlooked when the
> omap3_pm_init() routine had the prcm chain handler code
> added.  Fix this by adding a goto target and reordering
> the error handling code.  Also fix how the irq argument
> for free_irq() is determined.

You are right, it looks like the error handling part was accidentally
dropped from version 7 of the prcm patch set.

Acked-by: Tero Kristo <t-kristo@ti.com>

Paul, you going to grab this?

-Tero


> 
> CC: Tero Kristo <t-kristo@ti.com>
> Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
> ---
>  arch/arm/mach-omap2/pm34xx.c |   16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 27fc7a2..af8d741 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -817,13 +817,13 @@ static int __init omap3_pm_init(void)
>  
>  	if (ret) {
>  		pr_err("pm: Failed to request pm_io irq\n");
> -		goto err1;
> +		goto err2;
>  	}
>  
>  	ret = pwrdm_for_each(pwrdms_setup, NULL);
>  	if (ret) {
>  		printk(KERN_ERR "Failed to setup powerdomains\n");
> -		goto err2;
> +		goto err3;
>  	}
>  
>  	(void) clkdm_for_each(clkdms_setup, NULL);
> @@ -831,7 +831,8 @@ static int __init omap3_pm_init(void)
>  	mpu_pwrdm = pwrdm_lookup("mpu_pwrdm");
>  	if (mpu_pwrdm == NULL) {
>  		printk(KERN_ERR "Failed to get mpu_pwrdm\n");
> -		goto err2;
> +		ret = -EINVAL;
> +		goto err3;
>  	}
>  
>  	neon_pwrdm = pwrdm_lookup("neon_pwrdm");
> @@ -879,14 +880,17 @@ static int __init omap3_pm_init(void)
>  	}
>  
>  	omap3_save_scratchpad_contents();
> -err1:
>  	return ret;
> -err2:
> -	free_irq(INT_34XX_PRCM_MPU_IRQ, NULL);
> +
> +err3:
>  	list_for_each_entry_safe(pwrst, tmp, &pwrst_list, node) {
>  		list_del(&pwrst->node);
>  		kfree(pwrst);
>  	}
> +	free_irq(omap_prcm_event_to_irq("io"), omap3_pm_init);
> +err2:
> +	free_irq(omap_prcm_event_to_irq("wkup"), NULL);
> +err1:
>  	return ret;
>  }
>  

  reply	other threads:[~2012-03-19  9:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-18  1:22 [PATCH v3 0/2] arm: omap3: pm34xx.c: Some minor fixups Mark A. Greer
2012-03-18  1:22 ` [PATCH v3 1/2] arm: omap3: pm34xx.c: Fix omap3_pm_init() error out paths Mark A. Greer
2012-03-19  9:48   ` Tero Kristo [this message]
2012-03-20  9:17     ` Paul Walmsley
2012-03-20 14:02       ` Kevin Hilman
2012-03-18  1:22 ` [PATCH v3 2/2] arm: omap3: pm34xx.c: Replace printk() with appropriate pr_*() Mark A. Greer
2012-03-19 21:43 ` [PATCH v3 0/2] arm: omap3: pm34xx.c: Some minor fixups Kevin Hilman

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=1332150525.2116.334.camel@sokoban \
    --to=t-kristo@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).