diff options
author | Mark A. Greer <mgreer@animalcreek.com> | 2012-03-17 21:22:47 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-03-22 19:11:17 -0400 |
commit | ce229c5d79c03f09d4612dd2bcbff532fdc24e80 (patch) | |
tree | 5261fc07ea405f8e27234a99f1c28ff4b5813d9b /arch/arm/mach-omap2/pm34xx.c | |
parent | 68523f4233de5f233478dde0a63047b4efb710b8 (diff) |
arm: omap3: pm34xx.c: Fix omap3_pm_init() error out paths
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>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index fc6987578920..c598d26f3317 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) | |||
817 | 817 | ||
818 | if (ret) { | 818 | if (ret) { |
819 | pr_err("pm: Failed to request pm_io irq\n"); | 819 | pr_err("pm: Failed to request pm_io irq\n"); |
820 | goto err1; | 820 | goto err2; |
821 | } | 821 | } |
822 | 822 | ||
823 | ret = pwrdm_for_each(pwrdms_setup, NULL); | 823 | ret = pwrdm_for_each(pwrdms_setup, NULL); |
824 | if (ret) { | 824 | if (ret) { |
825 | printk(KERN_ERR "Failed to setup powerdomains\n"); | 825 | printk(KERN_ERR "Failed to setup powerdomains\n"); |
826 | goto err2; | 826 | goto err3; |
827 | } | 827 | } |
828 | 828 | ||
829 | (void) clkdm_for_each(clkdms_setup, NULL); | 829 | (void) clkdm_for_each(clkdms_setup, NULL); |
@@ -831,7 +831,8 @@ static int __init omap3_pm_init(void) | |||
831 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); | 831 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); |
832 | if (mpu_pwrdm == NULL) { | 832 | if (mpu_pwrdm == NULL) { |
833 | printk(KERN_ERR "Failed to get mpu_pwrdm\n"); | 833 | printk(KERN_ERR "Failed to get mpu_pwrdm\n"); |
834 | goto err2; | 834 | ret = -EINVAL; |
835 | goto err3; | ||
835 | } | 836 | } |
836 | 837 | ||
837 | neon_pwrdm = pwrdm_lookup("neon_pwrdm"); | 838 | neon_pwrdm = pwrdm_lookup("neon_pwrdm"); |
@@ -879,14 +880,17 @@ static int __init omap3_pm_init(void) | |||
879 | } | 880 | } |
880 | 881 | ||
881 | omap3_save_scratchpad_contents(); | 882 | omap3_save_scratchpad_contents(); |
882 | err1: | ||
883 | return ret; | 883 | return ret; |
884 | err2: | 884 | |
885 | free_irq(INT_34XX_PRCM_MPU_IRQ, NULL); | 885 | err3: |
886 | list_for_each_entry_safe(pwrst, tmp, &pwrst_list, node) { | 886 | list_for_each_entry_safe(pwrst, tmp, &pwrst_list, node) { |
887 | list_del(&pwrst->node); | 887 | list_del(&pwrst->node); |
888 | kfree(pwrst); | 888 | kfree(pwrst); |
889 | } | 889 | } |
890 | free_irq(omap_prcm_event_to_irq("io"), omap3_pm_init); | ||
891 | err2: | ||
892 | free_irq(omap_prcm_event_to_irq("wkup"), NULL); | ||
893 | err1: | ||
890 | return ret; | 894 | return ret; |
891 | } | 895 | } |
892 | 896 | ||