lkml.org 
[lkml]   [2017]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.9 074/100] rtc: pl031: make interrupt optional
    Date
    From: Russell King <rmk+kernel@armlinux.org.uk>

    [ Upstream commit 5b64a2965dfdfca8039e93303c64e2b15c19ff0c ]

    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>
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    ---
    drivers/rtc/rtc-pl031.c | 14 ++++++++------
    1 file changed, 8 insertions(+), 6 deletions(-)

    diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
    index e1687e19c59f..a30f24cb6c83 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)

    dev_pm_clear_wake_irq(&adev->dev);
    device_init_wakeup(&adev->dev, false);
    - free_irq(adev->irq[0], ldata);
    + if (adev->irq[0])
    + free_irq(adev->irq[0], ldata);
    rtc_device_unregister(ldata->rtc);
    iounmap(ldata->base);
    kfree(ldata);
    @@ -381,12 +382,13 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
    goto out_no_rtc;
    }

    - if (request_irq(adev->irq[0], pl031_interrupt,
    - vendor->irqflags, "rtc-pl031", ldata)) {
    - ret = -EIO;
    - goto out_no_irq;
    + if (adev->irq[0]) {
    + ret = request_irq(adev->irq[0], pl031_interrupt,
    + vendor->irqflags, "rtc-pl031", ldata);
    + if (ret)
    + 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;

    out_no_irq:
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-12-13 03:35    [W:4.106 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site