From: Andrew Lunn <andrew@lunn.ch>
To: 李哲 <sensor1010@163.com>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com,
alexandre.torgue@foss.st.com, jonas@kwiboo.se,
rmk+kernel@armlinux.org.uk, david.wu@rock-chips.com,
wens@csie.org, jan.petrous@oss.nxp.com, netdev@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: dwmac-rk: No need to check the return value of the phy_power_on()
Date: Mon, 26 May 2025 19:05:08 +0200 [thread overview]
Message-ID: <e178677c-c8aa-462b-8d12-e0b4b8b6c7b7@lunn.ch> (raw)
In-Reply-To: <20250526161621.3549-1-sensor1010@163.com>
On Mon, May 26, 2025 at 09:16:21AM -0700, 李哲 wrote:
> since the return value of the phy_power_on() function is always 0,
> checking its return value is redundant.
>
> Signed-off-by: 李哲 <sensor1010@163.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> index 700858ff6f7c..6e8b10fda24d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> @@ -1839,11 +1839,7 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
> dev_err(dev, "NO interface defined!\n");
> }
>
> - ret = phy_power_on(bsp_priv, true);
> - if (ret) {
> - gmac_clk_enable(bsp_priv, false);
> - return ret;
> - }
> + phy_power_on(bsp_priv, true);
I suggest you go one step further and turn phy_power_on() into a void
function.
net-next is closed for the next two week due to the merge window.
Andrew
next prev parent reply other threads:[~2025-05-26 17:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-26 16:16 [PATCH] net: dwmac-rk: No need to check the return value of the phy_power_on() 李哲
2025-05-26 17:05 ` Andrew Lunn [this message]
2025-05-27 5:43 ` Christophe JAILLET
2025-05-27 13:14 ` Andrew Lunn
-- strict thread matches above, loose matches on Subject: below --
2025-05-30 16:20 李哲
2025-05-30 16:37 ` Russell King (Oracle)
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=e178677c-c8aa-462b-8d12-e0b4b8b6c7b7@lunn.ch \
--to=andrew@lunn.ch \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=david.wu@rock-chips.com \
--cc=edumazet@google.com \
--cc=jan.petrous@oss.nxp.com \
--cc=jonas@kwiboo.se \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=sensor1010@163.com \
--cc=wens@csie.org \
/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