diff options
Diffstat (limited to 'drivers/mfd/db8500-prcmu.c')
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 193cf168ba84..a8204730f01c 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -3150,23 +3150,28 @@ static int db8500_prcmu_probe(struct platform_device *pdev) | |||
3150 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu"); | 3150 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu"); |
3151 | if (!res) { | 3151 | if (!res) { |
3152 | dev_err(&pdev->dev, "no prcmu memory region provided\n"); | 3152 | dev_err(&pdev->dev, "no prcmu memory region provided\n"); |
3153 | return -ENOENT; | 3153 | return -EINVAL; |
3154 | } | 3154 | } |
3155 | prcmu_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); | 3155 | prcmu_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); |
3156 | if (!prcmu_base) { | 3156 | if (!prcmu_base) { |
3157 | dev_err(&pdev->dev, | 3157 | dev_err(&pdev->dev, |
3158 | "failed to ioremap prcmu register memory\n"); | 3158 | "failed to ioremap prcmu register memory\n"); |
3159 | return -ENOENT; | 3159 | return -ENOMEM; |
3160 | } | 3160 | } |
3161 | init_prcm_registers(); | 3161 | init_prcm_registers(); |
3162 | dbx500_fw_version_init(pdev, pdata->version_offset); | 3162 | dbx500_fw_version_init(pdev, pdata->version_offset); |
3163 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcdm"); | 3163 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcdm"); |
3164 | if (!res) { | 3164 | if (!res) { |
3165 | dev_err(&pdev->dev, "no prcmu tcdm region provided\n"); | 3165 | dev_err(&pdev->dev, "no prcmu tcdm region provided\n"); |
3166 | return -ENOENT; | 3166 | return -EINVAL; |
3167 | } | 3167 | } |
3168 | tcdm_base = devm_ioremap(&pdev->dev, res->start, | 3168 | tcdm_base = devm_ioremap(&pdev->dev, res->start, |
3169 | resource_size(res)); | 3169 | resource_size(res)); |
3170 | if (!tcdm_base) { | ||
3171 | dev_err(&pdev->dev, | ||
3172 | "failed to ioremap prcmu-tcdm register memory\n"); | ||
3173 | return -ENOMEM; | ||
3174 | } | ||
3170 | 3175 | ||
3171 | /* Clean up the mailbox interrupts after pre-kernel code. */ | 3176 | /* Clean up the mailbox interrupts after pre-kernel code. */ |
3172 | writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR); | 3177 | writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR); |
@@ -3174,15 +3179,14 @@ static int db8500_prcmu_probe(struct platform_device *pdev) | |||
3174 | irq = platform_get_irq(pdev, 0); | 3179 | irq = platform_get_irq(pdev, 0); |
3175 | if (irq <= 0) { | 3180 | if (irq <= 0) { |
3176 | dev_err(&pdev->dev, "no prcmu irq provided\n"); | 3181 | dev_err(&pdev->dev, "no prcmu irq provided\n"); |
3177 | return -ENOENT; | 3182 | return irq; |
3178 | } | 3183 | } |
3179 | 3184 | ||
3180 | err = request_threaded_irq(irq, prcmu_irq_handler, | 3185 | err = request_threaded_irq(irq, prcmu_irq_handler, |
3181 | prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL); | 3186 | prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL); |
3182 | if (err < 0) { | 3187 | if (err < 0) { |
3183 | pr_err("prcmu: Failed to allocate IRQ_DB8500_PRCMU1.\n"); | 3188 | pr_err("prcmu: Failed to allocate IRQ_DB8500_PRCMU1.\n"); |
3184 | err = -EBUSY; | 3189 | return err; |
3185 | goto no_irq_return; | ||
3186 | } | 3190 | } |
3187 | 3191 | ||
3188 | db8500_irq_init(np); | 3192 | db8500_irq_init(np); |
@@ -3206,7 +3210,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev) | |||
3206 | if (err) { | 3210 | if (err) { |
3207 | mfd_remove_devices(&pdev->dev); | 3211 | mfd_remove_devices(&pdev->dev); |
3208 | pr_err("prcmu: Failed to add subdevices\n"); | 3212 | pr_err("prcmu: Failed to add subdevices\n"); |
3209 | goto no_irq_return; | 3213 | return err; |
3210 | } | 3214 | } |
3211 | } | 3215 | } |
3212 | 3216 | ||
@@ -3214,12 +3218,10 @@ static int db8500_prcmu_probe(struct platform_device *pdev) | |||
3214 | if (err) { | 3218 | if (err) { |
3215 | mfd_remove_devices(&pdev->dev); | 3219 | mfd_remove_devices(&pdev->dev); |
3216 | pr_err("prcmu: Failed to add ab8500 subdevice\n"); | 3220 | pr_err("prcmu: Failed to add ab8500 subdevice\n"); |
3217 | goto no_irq_return; | 3221 | return err; |
3218 | } | 3222 | } |
3219 | 3223 | ||
3220 | pr_info("DB8500 PRCMU initialized\n"); | 3224 | pr_info("DB8500 PRCMU initialized\n"); |
3221 | |||
3222 | no_irq_return: | ||
3223 | return err; | 3225 | return err; |
3224 | } | 3226 | } |
3225 | static const struct of_device_id db8500_prcmu_match[] = { | 3227 | static const struct of_device_id db8500_prcmu_match[] = { |