[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 2 Feb 2022 13:20:02 -0600
From: Dave Gerlach <d-gerlach@...com>
To: Miaoqian Lin <linmq006@...il.com>, Nishanth Menon <nm@...com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Tony Lindgren <tony@...mide.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] soc: ti: wkup_m3_ipc: Fix IRQ check in wkup_m3_ipc_probe
Hi,
On 1/14/22 00:28, Miaoqian Lin wrote:
> platform_get_irq() returns negative error number instead 0 on failure.
> And the doc of platform_get_irq() provides a usage example:
>
> int irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return irq;
>
> Fix the check of return value to catch errors correctly.
>
Looks good to me.
Acked-by: Dave Gerlach <d-gerlach@...com>
> Fixes: cdd5de500b2c ("soc: ti: Add wkup_m3_ipc driver")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
> drivers/soc/ti/wkup_m3_ipc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
> index 72386bd393fe..2f03ced0f411 100644
> --- a/drivers/soc/ti/wkup_m3_ipc.c
> +++ b/drivers/soc/ti/wkup_m3_ipc.c
> @@ -450,9 +450,9 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
> return PTR_ERR(m3_ipc->ipc_mem_base);
>
> irq = platform_get_irq(pdev, 0);
> - if (!irq) {
> + if (irq < 0) {
> dev_err(&pdev->dev, "no irq resource\n");
> - return -ENXIO;
> + return irq;
> }
>
> ret = devm_request_irq(dev, irq, wkup_m3_txev_handler,
Powered by blists - more mailing lists