Messages in this thread | | | Date | Mon, 14 Mar 2022 14:04:13 +0100 | From | Andrew Lunn <> | Subject | Re: [PATCH V3] net: mv643xx_eth: use platform_get_irq() instead of platform_get_resource() |
| |
> - 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
| |