diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-09-29 06:22:15 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-10-12 10:30:30 -0400 |
commit | 5b64a2965dfdfca8039e93303c64e2b15c19ff0c (patch) | |
tree | d4673f18f817d8735c74be9464e550ab24f994c8 /drivers/rtc | |
parent | b86f581f8cdbec3655d400ad952c2203a74edde1 (diff) |
rtc: pl031: make interrupt optional
On some platforms, the interrupt for the PL031 is optional. Avoid
trying to claim the interrupt if it's not specified.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-pl031.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 64c77ec1b4ea..82eb7da2c478 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c | |||
@@ -308,7 +308,8 @@ static int pl031_remove(struct amba_device *adev) | |||
308 | 308 | ||
309 | dev_pm_clear_wake_irq(&adev->dev); | 309 | dev_pm_clear_wake_irq(&adev->dev); |
310 | device_init_wakeup(&adev->dev, false); | 310 | device_init_wakeup(&adev->dev, false); |
311 | free_irq(adev->irq[0], ldata); | 311 | if (adev->irq[0]) |
312 | free_irq(adev->irq[0], ldata); | ||
312 | rtc_device_unregister(ldata->rtc); | 313 | rtc_device_unregister(ldata->rtc); |
313 | amba_release_regions(adev); | 314 | amba_release_regions(adev); |
314 | 315 | ||
@@ -389,12 +390,13 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) | |||
389 | goto out; | 390 | goto out; |
390 | } | 391 | } |
391 | 392 | ||
392 | if (request_irq(adev->irq[0], pl031_interrupt, | 393 | if (adev->irq[0]) { |
393 | vendor->irqflags, "rtc-pl031", ldata)) { | 394 | ret = request_irq(adev->irq[0], pl031_interrupt, |
394 | ret = -EIO; | 395 | vendor->irqflags, "rtc-pl031", ldata); |
395 | goto out_no_irq; | 396 | if (ret) |
397 | goto out_no_irq; | ||
398 | dev_pm_set_wake_irq(&adev->dev, adev->irq[0]); | ||
396 | } | 399 | } |
397 | dev_pm_set_wake_irq(&adev->dev, adev->irq[0]); | ||
398 | return 0; | 400 | return 0; |
399 | 401 | ||
400 | out_no_irq: | 402 | out_no_irq: |