[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230318065509.51019-1-dddddd@hust.edu.cn>
Date: Sat, 18 Mar 2023 14:55:09 +0800
From: huyinhao <dddddd@...t.edu.cn>
To: joel@....id.au
Cc: linux-arm-kernel@...ts.infradead.org,
linux-aspeed@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
huyinhao <dddddd@...t.edu.cn>, Dongliang Mu <dzm91@...t.edu.cn>
Subject: [PATCH v2] drivers: soc: fix dead code in aspeed_lpc_snoop_config_irq
>From the comment of platform_get_irq, it only returns non-zero IRQ
number and negative error number, other than zero.
Fix this if condition when platform_get_irq returns a negative
error number.
Signed-off-by: huyinhao <dddddd@...t.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
---
v1->v2: Change "Signed-off-by" to "Reviewed-by"
and change the email of "From" to "Signed-off-by"
drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c
index eceeaf8dfbeb..c4a03b3a5cf8 100644
--- a/drivers/soc/aspeed/aspeed-lpc-snoop.c
+++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c
@@ -167,8 +167,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
int rc;
lpc_snoop->irq = platform_get_irq(pdev, 0);
- if (!lpc_snoop->irq)
- return -ENODEV;
+ if (lpc_snoop->irq < 0)
+ return lpc_snoop->irq;
rc = devm_request_irq(dev, lpc_snoop->irq,
aspeed_lpc_snoop_irq, IRQF_SHARED,
--
2.34.1
Powered by blists - more mailing lists