Re: [PATCH V3] net: mv643xx_eth: use platform_get_irq() instead of platform_get_resource()

From: Andrew Lunn
Date: Mon Mar 14 2022 - 09:04:30 EST


> - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> - BUG_ON(!res);
> - dev->irq = res->start;
> + irq = platform_get_irq(pdev, 0);
> + if (WARN_ON(irq < 0)) {
> + if (!IS_ERR(mp->clk))
> + clk_disable_unprepare(mp->clk);
> + free_netdev(dev);
> + return irq;
> + }

Why not
goto out;

?

And FYI: You can pass an error code to clk_disable_unprepare() and it
will not care and do the right thing. So if you were to keep this
code, which you should not, you don't need the if !IS_ERR(mp->clk))


Andrew