From: Dongliang Mu <mudongliangabcd@gmail.com>
Date: Mon, 26 Sep 2022 13:59:21 +0000 (+0800)
Subject: usb: cdns3: remove dead code
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=29afbe5f5afc2f724b8aef2d11fbe6a7ee48997e;p=linux.git

usb: cdns3: remove dead code

Smatch reports the following error:

drivers/usb/cdns3/cdns3-plat.c:113 cdns3_plat_probe() warn:
platform_get_irq() does not return zero

From the document, platform_get_irq_byname_optional only returns
non-zero value, and negative value on failure.

Fix this by removing the zero value checking.

Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Link: https://lore.kernel.org/r/20220926135922.24541-1-dzm91@hust.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c
index dc068e940ed59..2bc5d094548b6 100644
--- a/drivers/usb/cdns3/cdns3-plat.c
+++ b/drivers/usb/cdns3/cdns3-plat.c
@@ -110,8 +110,6 @@ static int cdns3_plat_probe(struct platform_device *pdev)
 	cdns->wakeup_irq = platform_get_irq_byname_optional(pdev, "wakeup");
 	if (cdns->wakeup_irq == -EPROBE_DEFER)
 		return cdns->wakeup_irq;
-	else if (cdns->wakeup_irq == 0)
-		return -EINVAL;
 
 	if (cdns->wakeup_irq < 0) {
 		dev_dbg(dev, "couldn't get wakeup irq\n");