Re: [PATCH v3 1/2] arm: omap3: pm34xx.c: Fix omap3_pm_init() error out paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2012-03-17 at 18:22 -0700, Mark A. Greer wrote:
> From: "Mark A. Greer" <mgreer@xxxxxxxxxxxxxxx>
> 
> 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@xxxxxx>

Paul, you going to grab this?

-Tero


> 
> CC: Tero Kristo <t-kristo@xxxxxx>
> Signed-off-by: Mark A. Greer <mgreer@xxxxxxxxxxxxxxx>
> ---
>  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;
>  }
>  


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux