Message ID | 20230901070443.1308314-1-ruanjinjie@huawei.com (mailing list archive) |
---|---|
State | Deferred |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: bcmasp: Do not check for 0 return after calling platform_get_irq() | expand |
On Fri, Sep 01, 2023 at 03:04:43PM +0800, Jinjie Ruan wrote: > It is not possible for platform_get_irq() to return 0. And it return > -EINVAL when the irq = 0 and -ENXIO when the irq can not be found. The > best practice is to return the err code from platform_get_irq(). > > Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller") Hi Jinjie Ruan, This seems more like a cleanup than a fix, I think the tag should be dropped. > Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> ## Form letter - net-next-closed The merge window for v6.6 has begun and therefore net-next is closed for new drivers, features, code refactoring and optimizations. We are currently accepting bug fixes only. Please repost when net-next reopens after Sept 11th. RFC patches sent for review only are obviously welcome at any time. See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle -- pw-bot: defer
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c index d63d321f3e7b..05b07da03398 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c @@ -1231,8 +1231,8 @@ static int bcmasp_probe(struct platform_device *pdev) return -ENOMEM; priv->irq = platform_get_irq(pdev, 0); - if (priv->irq <= 0) - return -EINVAL; + if (priv->irq < 0) + return priv->irq; priv->clk = devm_clk_get_optional_enabled(dev, "sw_asp"); if (IS_ERR(priv->clk))
It is not possible for platform_get_irq() to return 0. And it return -EINVAL when the irq = 0 and -ENXIO when the irq can not be found. The best practice is to return the err code from platform_get_irq(). Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> --- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)