[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM5PR1001MB0994628BB79E451FB8BEDC07809B0@AM5PR1001MB0994.EURPRD10.PROD.OUTLOOK.COM>
Date: Mon, 7 Oct 2019 10:40:59 +0000
From: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
To: Krzysztof Kozlowski <krzk@...nel.org>,
Support Opensource <Support.Opensource@...semi.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
"linux-rtc@...r.kernel.org" <linux-rtc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [RFT] rtc: da9063: Handle invalid IRQ from
platform_get_irq_byname()
On 04 October 2019 16:05, Krzysztof Kozlowski wrote:
> platform_get_irq_byname() might return -errno which later would be
> cast to an unsigned int and used in request_irq().
>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
This doesn't break the existing RTC functionality when running up on my test
board with DA9063. Although very unlikely to occur it does make sense so:
Tested-by: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
>
> ---
>
> Not marking as cc-stable as this was not reproduced and not tested.
> ---
> drivers/rtc/rtc-da9063.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
> index 15908d51b1cb..046b1d4c3dae 100644
> --- a/drivers/rtc/rtc-da9063.c
> +++ b/drivers/rtc/rtc-da9063.c
> @@ -483,6 +483,9 @@ static int da9063_rtc_probe(struct platform_device
> *pdev)
> rtc->rtc_dev->uie_unsupported = 1;
>
> irq_alarm = platform_get_irq_byname(pdev, "ALARM");
> + if (irq_alarm < 0)
> + return irq_alarm;
> +
> ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL,
> da9063_alarm_event,
> IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> --
Powered by blists - more mailing lists