From: Andrew Lunn <andrew@lunn.ch>
To: cgel.zte@gmail.com
Cc: kuba@kernel.org, chi.minghao@zte.com.cn, davem@davemloft.net,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
sebastian.hesselbarth@gmail.com, zealci@zte.com.cn
Subject: Re: [PATCH V3] net: mv643xx_eth: use platform_get_irq() instead of platform_get_resource()
Date: Mon, 14 Mar 2022 14:04:13 +0100 [thread overview]
Message-ID: <Yi89TfRTlM7OxYzb@lunn.ch> (raw)
In-Reply-To: <20220314024144.2112308-1-chi.minghao@zte.com.cn>
> - 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
next prev parent reply other threads:[~2022-03-14 13:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 6:20 [PATCH V2] net: mv643xx_eth: use platform_get_irq() instead of platform_get_resource() cgel.zte
2022-03-11 11:10 ` patchwork-bot+netdevbpf
2022-03-11 16:20 ` Jakub Kicinski
2022-03-14 2:41 ` [PATCH V3] " cgel.zte
2022-03-14 13:04 ` Andrew Lunn [this message]
2022-03-14 16:40 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yi89TfRTlM7OxYzb@lunn.ch \
--to=andrew@lunn.ch \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).