Message ID | 20230803035800.32891-1-wangzhu9@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | adbe9720e573d0466b506df3b848bcf4c4dd63c9 |
Headers | show |
Series | [-next] usb: musb: Do not check 0 for platform_get_irq() | expand |
On 8/3/23 6:58 AM, Zhu Wang wrote: > Since platform_get_irq() never returned zero, so it need not to check > whether it returned zero, and we use the return error code of > platform_get_irq() to replace the current return error code. You don't say anything about fixing the deferred probing which this patch mainly does... > Please refer to the commit a85a6c86c25b ("driver core: platform: Clarify > that IRQ 0 is invalid") to get that platform_get_irq() never returned > zero. Not true, it only WARNs about IRQ0. 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> > --- > 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; Hm, I thought I've done it long ago, but apparently not... :-( [...] So, the change is OK but the description is not... MBR, Sergey
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))
Since platform_get_irq() never returned zero, so it need not to check whether it returned zero, and we use the return error code of platform_get_irq() to replace the current return error code. Please refer to the commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0 is invalid") to get that platform_get_irq() never returned zero. Signed-off-by: Zhu Wang <wangzhu9@huawei.com> --- drivers/usb/musb/musb_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)