diff mbox series

[net-next] net: bcmasp: Do not check for 0 return after calling platform_get_irq()

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

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jinjie Ruan Sept. 1, 2023, 7:04 a.m. UTC
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(-)

Comments

Simon Horman Sept. 1, 2023, 2:02 p.m. UTC | #1
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 mbox series

Patch

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))