* [PATCH v2 RESEND] drivers: soc: fix dead code in aspeed_lpc_snoop_config_irq
@ 2023-03-24 2:15 ` huyinhao
0 siblings, 0 replies; 2+ messages in thread
From: huyinhao @ 2023-03-24 2:15 UTC (permalink / raw)
To: joel, andrew
Cc: linux-arm-kernel, linux-aspeed, linux-kernel,
hust-os-kernel-patches, huyinhao, Dongliang Mu
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@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v2 RESEND] drivers: soc: fix dead code in aspeed_lpc_snoop_config_irq
@ 2023-03-24 2:15 ` huyinhao
0 siblings, 0 replies; 2+ messages in thread
From: huyinhao @ 2023-03-24 2:15 UTC (permalink / raw)
To: joel, andrew
Cc: linux-arm-kernel, linux-aspeed, linux-kernel,
hust-os-kernel-patches, huyinhao, Dongliang Mu
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@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-24 2:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 2:15 [PATCH v2 RESEND] drivers: soc: fix dead code in aspeed_lpc_snoop_config_irq huyinhao
2023-03-24 2:15 ` huyinhao
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.