[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yi89TfRTlM7OxYzb@lunn.ch>
Date: Mon, 14 Mar 2022 14:04:13 +0100
From: Andrew Lunn <andrew@...n.ch>
To: cgel.zte@...il.com
Cc: kuba@...nel.org, chi.minghao@....com.cn, davem@...emloft.net,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
sebastian.hesselbarth@...il.com, zealci@....com.cn
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
Powered by blists - more mailing lists