* [PATCH -next v3] usb: gadget: udc: gr_udc: Do not check 0 for platform_get_irq()
@ 2023-08-03 12:11 Zhu Wang
2023-08-03 17:00 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Zhu Wang @ 2023-08-03 12:11 UTC (permalink / raw)
To: gregkh, herve.codina, stern, robh, aaro.koskinen,
sergei.shtylyov, linux-usb, linux-kernel
Cc: wangzhu9
When platform_get_irq() 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() 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() cannot be override.
---
drivers/usb/gadget/udc/gr_udc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c
index 0c3969301a53..c6dfa7cccc11 100644
--- a/drivers/usb/gadget/udc/gr_udc.c
+++ b/drivers/usb/gadget/udc/gr_udc.c
@@ -2136,15 +2136,15 @@ static int gr_probe(struct platform_device *pdev)
return PTR_ERR(regs);
dev->irq = platform_get_irq(pdev, 0);
- if (dev->irq <= 0)
- return -ENODEV;
+ if (dev->irq < 0)
+ return dev->irq;
/* Some core configurations has separate irqs for IN and OUT events */
dev->irqi = platform_get_irq(pdev, 1);
if (dev->irqi > 0) {
dev->irqo = platform_get_irq(pdev, 2);
- if (dev->irqo <= 0)
- return -ENODEV;
+ if (dev->irqo < 0)
+ return dev->irqo;
} else {
dev->irqi = 0;
}
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH -next v3] usb: gadget: udc: gr_udc: Do not check 0 for platform_get_irq()
2023-08-03 12:11 [PATCH -next v3] usb: gadget: udc: gr_udc: Do not check 0 for platform_get_irq() Zhu Wang
@ 2023-08-03 17:00 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2023-08-03 17:00 UTC (permalink / raw)
To: Zhu Wang, gregkh, herve.codina, stern, robh, aaro.koskinen,
linux-usb, linux-kernel
On 8/3/23 3:11 PM, Zhu Wang wrote:
> When platform_get_irq() failed, it may return -EPROBE_DEFER, -EINVAL or
> -ENXIO, it is important to propagate the detail upstream, we cannot
> override it.
Deferred probing being fixed should be emphasized. And the patch is
no longer "-next" material due to that...
> And platform_get_irq() used to return 0 (as both IRQ0 and error
> indication), there are several patches fixing the inconsistencies.
No, this "historical" passage wasn't meant to be a part of the patch
description.
> 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() cannot be override.
As I said, your descrioption isn't very convincing as you don't
emphasize the deferred probing being fixed.
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-03 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 12:11 [PATCH -next v3] usb: gadget: udc: gr_udc: Do not check 0 for platform_get_irq() Zhu Wang
2023-08-03 17:00 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®