Commit 5b64a296 authored by Russell King's avatar Russell King Committed by Alexandre Belloni

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: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent b86f581f
...@@ -308,6 +308,7 @@ static int pl031_remove(struct amba_device *adev) ...@@ -308,6 +308,7 @@ static int pl031_remove(struct amba_device *adev)
dev_pm_clear_wake_irq(&adev->dev); dev_pm_clear_wake_irq(&adev->dev);
device_init_wakeup(&adev->dev, false); device_init_wakeup(&adev->dev, false);
if (adev->irq[0])
free_irq(adev->irq[0], ldata); free_irq(adev->irq[0], ldata);
rtc_device_unregister(ldata->rtc); rtc_device_unregister(ldata->rtc);
amba_release_regions(adev); amba_release_regions(adev);
...@@ -389,12 +390,13 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -389,12 +390,13 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
goto out; goto out;
} }
if (request_irq(adev->irq[0], pl031_interrupt, if (adev->irq[0]) {
vendor->irqflags, "rtc-pl031", ldata)) { ret = request_irq(adev->irq[0], pl031_interrupt,
ret = -EIO; vendor->irqflags, "rtc-pl031", ldata);
if (ret)
goto out_no_irq; goto out_no_irq;
}
dev_pm_set_wake_irq(&adev->dev, adev->irq[0]); dev_pm_set_wake_irq(&adev->dev, adev->irq[0]);
}
return 0; return 0;
out_no_irq: out_no_irq:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment