diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-01-21 11:45:16 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:50:50 -0700 |
commit | 56a1ec78bc8efe78ce24a0dd3b4be04dd4137164 (patch) | |
tree | ce235e09acda791a74929e0e9affb08513c10386 /drivers/rtc | |
parent | 5280b60bf1f20a95e08d5579af8285365f3d54b0 (diff) |
rtc: max77660: use platform_get_irq() for getting irq number
Use platform_get_irq() for getting irq number in place of directly
accessing irq through platform data.
Also doing some cleanups related to interrupts.
Change-Id: I860939072f227db7ee14b005865c591b08dc9899
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/192836
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-max77660.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-max77660.c b/drivers/rtc/rtc-max77660.c index c818dd2cc610..ecceda54dc8f 100644 --- a/drivers/rtc/rtc-max77660.c +++ b/drivers/rtc/rtc-max77660.c @@ -519,8 +519,6 @@ static int max77660_rtc_preinit(struct max77660_rtc *rtc) static int __devinit max77660_rtc_probe(struct platform_device *pdev) { - struct max77660_platform_data *parent_pdata = - pdev->dev.parent->platform_data; static struct max77660_rtc *rtc; int ret = 0; @@ -549,21 +547,19 @@ static int __devinit max77660_rtc_probe(struct platform_device *pdev) goto out; } - if (parent_pdata->irq_base < 0) - goto out; - - rtc->irq = parent_pdata->irq_base + MAX77660_IRQ_RTC; + rtc->irq = platform_get_irq(pdev, 0); ret = request_threaded_irq(rtc->irq, NULL, max77660_rtc_irq, - IRQF_ONESHOT | IRQF_EARLY_RESUME, "max77660-rtc", rtc); + IRQF_ONESHOT | IRQF_EARLY_RESUME, dev_name(&pdev->dev), rtc); if (ret < 0) { - dev_err(rtc->dev, "probe: Failed to request irq %d\n", - rtc->irq); - rtc->irq = -1; + dev_err(rtc->dev, "request irq %d failed: %dn", rtc->irq, ret); + goto out_rtc_free; } device_set_wakeup_capable(&pdev->dev, 1); return 0; +out_rtc_free: + rtc_device_unregister(rtc->rtc); out: mutex_destroy(&rtc->io_lock); return ret; @@ -573,8 +569,7 @@ static int __devexit max77660_rtc_remove(struct platform_device *pdev) { struct max77660_rtc *rtc = dev_get_drvdata(&pdev->dev); - if (rtc->irq != -1) - free_irq(rtc->irq, rtc); + free_irq(rtc->irq, rtc); rtc_device_unregister(rtc->rtc); mutex_destroy(&rtc->io_lock); |