rtc: palmas: get irq number through platform_get_irq()
Laxman Dewangan [Tue, 12 Mar 2013 08:30:29 +0000 (13:30 +0530)]
The palmas mfd driver pass the RTC interrupt through the IRQ_RESOURCE
and hence RTC driver can get the irq by calling platform_get_irq().

Change-Id: Ib6e4afd0511ab6cf80df43defe29ffe50480f27c
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/208338
(cherry picked from commit 34e9e76622d4cb6288fcfffbb537382628855a86)
Reviewed-on: http://git-master/r/209988
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Sumit Sharma <sumsharma@nvidia.com>

drivers/rtc/rtc-palmas.c

index aed71f5..148868a 100644 (file)
@@ -358,18 +358,8 @@ static int __devinit palmas_rtc_probe(struct platform_device *pdev)
                return ret;
        }
 
-       if (!regmap_irq_chip_get_base(palmas->irq_data))
-               return -EINVAL;
-
-       palmas_rtc->irq = regmap_irq_chip_get_base(palmas->irq_data);
-       if (palmas_rtc->irq <= 0) {
-               dev_err(&pdev->dev, "Wake up is not possible as irq = %d\n",
-                       palmas_rtc->irq);
-               return ret;
-       }
-
-       palmas_rtc->irq += PALMAS_RTC_ALARM_IRQ;
-
+       palmas_rtc->irq = platform_get_irq(pdev, 0);
+       dev_info(&pdev->dev, "RTC interrupt %d\n", palmas_rtc->irq);
        ret = request_threaded_irq(palmas_rtc->irq, NULL,
                palmas_rtc_interrupt, IRQF_TRIGGER_LOW,
                "palmas-rtc", &pdev->dev);