Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af826fdf authored by Russell King's avatar Russell King Committed by Greg Kroah-Hartman
Browse files

rtc: pl031: make interrupt optional




[ 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: 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>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd513989
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -308,6 +308,7 @@ static int pl031_remove(struct amba_device *adev)

	dev_pm_clear_wake_irq(&adev->dev);
	device_init_wakeup(&adev->dev, false);
	if (adev->irq[0])
		free_irq(adev->irq[0], ldata);
	rtc_device_unregister(ldata->rtc);
	iounmap(ldata->base);
@@ -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;
	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]);
	}
	return 0;

out_no_irq: