usb: musb: Do not check 0 for platform_get_irq_byname()
Subsystems (2)
PATCH v2 1/1 usb: musb: Do not check 0 for platform_get_irq_byname()
When platform_get_irq_byname() is called to get a interrupt number, it may return -EINVAL or -ENXIO when failed, while current code returned -ENODEV, so we replace it with the return value of platform_get_irq_byname(). And we found that platform_get_irq_byname() never returned zero by reading its code.
Commit ce753ad1549c ("platform: finally disallow IRQ0 in platform_get_irq() and its ilk") makes sure IRQ0 is not returned.
---
Changes in v2:
- Update the commit message, present the reason of replacing the return value of the probe.
--- drivers/usb/musb/musb_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +2 -2
@@ -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))
Signature · 1 line
2.17.1
Quoted 2 lines · Zhu Wang
When
platform_get_irq_byname()is called to get a interrupt number, it may return-EINVALor-ENXIOwhen failed, while current code returned
You still don't mention -EPROBE_DEFER. Propagating it upstream is
the _main_ reason we must not override what platform_get_irq_byname() returns!
Quoted 3 lines
-ENODEV, so we replace it with the return value ofplatform_get_irq_byname(). And we found thatplatform_get_irq_byname()never returned zero by reading its code.
It used to return 0 (as both IRQ0 and the error indication).
Historically, there were several patches fixing the inconsistencies...
Quoted 29 lines
Commit
ce753ad1549c("platform: finally disallow IRQ0 inplatform_get_irq()and its ilk") makes sure IRQ0 is not returned.Signed-off-by Zhu Wang <[email protected]>---
Changes in v2:
- Update the commit message, present the reason of replacing the return value of the probe.--- drivers/usb/musb/musb_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/musb/musb_core.c +2
-2@@ -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))