All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Wang <wangzhu9@huawei.com>
To: <b-liu@ti.com>, <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<sergei.shtylyov@gmail.com>
Cc: <wangzhu9@huawei.com>
Subject: [PATCH -next v3] usb: musb: Do not check 0 for platform_get_irq_byname()
Date: Thu, 3 Aug 2023 20:00:39 +0800	[thread overview]
Message-ID: <20230803120039.83502-1-wangzhu9@huawei.com> (raw)

When platform_get_irq_byname() failed, it may return -EPROBE_DEFER,
-EINVAL or -ENXIO, it is important to propagate the detail upstream, we
cannot override it.

And platform_get_irq_byname() used to return 0 (as both IRQ0 and error
indication), there are several patches fixing the inconsistencies.

Commit ce753ad1549c ("platform: finally disallow IRQ0 in
platform_get_irq() and its ilk") makes sure IRQ0 is not returned.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>

---
Changes in v2:
- Update the commit message, present the reason of replacing the return
value of the probe.

---
Changes in v3:
- Update the commit message, explain in detail why the return value of
platform_get_irq_byname() cannot be override.
---
 drivers/usb/musb/musb_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index ecbd3784bec3..b24adb5b399f 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2610,8 +2610,8 @@ static int musb_probe(struct platform_device *pdev)
 	int		irq = platform_get_irq_byname(pdev, "mc");
 	void __iomem	*base;
 
-	if (irq <= 0)
-		return -ENODEV;
+	if (irq < 0)
+		return irq;
 
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
-- 
2.17.1


             reply	other threads:[~2023-08-03 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 12:00 Zhu Wang [this message]
2023-08-03 16:44 ` [PATCH -next v3] usb: musb: Do not check 0 for platform_get_irq_byname() Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230803120039.83502-1-wangzhu9@huawei.com \
    --to=wangzhu9@huawei.com \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sergei.shtylyov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.