<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 13, 2022 at 10:44 PM Miaoqian Lin <<a href="mailto:linmq006@gmail.com">linmq006@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">platform_get_irq() returns negative error number instead 0 on failure.<br>
And the doc of platform_get_irq() provides a usage example:<br>
<br>
    int irq = platform_get_irq(pdev, 0);<br>
    if (irq < 0)<br>
        return irq;<br>
<br>
Fix the check of return value to catch errors correctly.<br>
<br>
Fixes: 524feb799408 ("soc: add aspeed folder and misc drivers")<br>
Signed-off-by: Miaoqian Lin <<a href="mailto:linmq006@gmail.com" target="_blank">linmq006@gmail.com</a>><br></blockquote><div><br></div><div>Signed-off-by: Patrick Venture <<a href="mailto:venture@google.com">venture@google.com</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 ++--<br>
 1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c<br>
index eceeaf8dfbeb..c4a03b3a5cf8 100644<br>
--- a/drivers/soc/aspeed/aspeed-lpc-snoop.c<br>
+++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c<br>
@@ -167,8 +167,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,<br>
        int rc;<br>
<br>
        lpc_snoop->irq = platform_get_irq(pdev, 0);<br>
-       if (!lpc_snoop->irq)<br>
-               return -ENODEV;<br>
+       if (lpc_snoop->irq < 0)<br>
+               return lpc_snoop->irq;<br>
<br>
        rc = devm_request_irq(dev, lpc_snoop->irq,<br>
                              aspeed_lpc_snoop_irq, IRQF_SHARED,<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div></div>