Skip to content

Commit

Permalink
arm: omap3: pm34xx.c: Fix omap3_pm_init() error out paths
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
  • Loading branch information
Mark A. Greer authored and Kevin Hilman committed Mar 22, 2012
1 parent 68523f4 commit ce229c5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,21 +817,22 @@ 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);

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");
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit ce229c5

Please sign in to comment.