diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-01-14 09:28:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-08 15:40:07 +0300 |
commit | 77406ac6efe44aba8601ea13a39bc6c5037c0897 (patch) | |
tree | 20219fbff7014e3206f58874e6b9ac26e61c80e8 /drivers/soc | |
parent | 18b2ec361a68b89248a13b22b4d572ccf5d5e54c (diff) | |
download | linux-77406ac6efe44aba8601ea13a39bc6c5037c0897.tar.xz |
soc: ti: wkup_m3_ipc: Fix IRQ check in wkup_m3_ipc_probe
[ Upstream commit c3d66a164c726cc3b072232d3b6d87575d194084 ]
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.
Fixes: cdd5de500b2c ("soc: ti: Add wkup_m3_ipc driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Dave Gerlach <d-gerlach@ti.com>
Link: https://lore.kernel.org/r/20220114062840.16620-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/ti/wkup_m3_ipc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c index e9ece45d7a33..ef3f95fefab5 100644 --- a/drivers/soc/ti/wkup_m3_ipc.c +++ b/drivers/soc/ti/wkup_m3_ipc.c @@ -447,9 +447,9 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) } 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, |