From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
"Jakub Kicinski" <kuba@kernel.org>,
davem@davemloft.net, "Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
thomas.petazzoni@bootlin.com,
"Alexis Lothoré" <alexis.lothore@bootlin.com>,
"Rohan G Thomas" <rohan.g.thomas@altera.com>,
"Mun Yew Tham" <mun.yew.tham@altera.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH net-next 5/5] net: stmmac: dwmac-sofcpga: Drop the struct device reference
Date: Tue, 24 Mar 2026 09:53:21 +0000 [thread overview]
Message-ID: <acJfEfLzOLYN9qJ_@shell.armlinux.org.uk> (raw)
In-Reply-To: <20260324092102.687082-6-maxime.chevallier@bootlin.com>
On Tue, Mar 24, 2026 at 10:21:00AM +0100, Maxime Chevallier wrote:
> We keep a reference to our the struct device in the socfpga_dwmac priv
> structure, but now it's only ever used to produce logs in the
> .set_phy_mode() ops, that are specific to this driver.
>
> When we call that ops, we always have a ref to the struct device around,
> so let's pass it to .set_phy_mode(). We can now discard that reference
> from struct socfpga_dwmac.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> ---
> .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> index ae40de2ed8eb..1d7f0a57d288 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> @@ -53,14 +53,14 @@
>
> struct socfpga_dwmac;
> struct socfpga_dwmac_ops {
> - int (*set_phy_mode)(struct socfpga_dwmac *dwmac_priv);
> + int (*set_phy_mode)(struct socfpga_dwmac *dwmac_priv,
> + struct device *dev);
As you're changing the signature of this method, would it be more
sensible to put "struct device *dev" as the first arg, rather than
swapping the order below:
> @@ -552,7 +553,7 @@ static int socfpga_dwmac_init(struct device *dev, void *bsp_priv)
> {
> struct socfpga_dwmac *dwmac = bsp_priv;
>
> - return dwmac->ops->set_phy_mode(dwmac);
> + return dwmac->ops->set_phy_mode(dwmac, dev);
?
In either case:
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2026-03-24 9:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 9:20 [PATCH net-next 0/5] net: stmmac: dwmac-socfpga: Cleanup .fix_mac_speed Maxime Chevallier
2026-03-24 9:20 ` [PATCH net-next 1/5] net: stmmac: dwmac-socfpga: Move internal helpers Maxime Chevallier
2026-03-24 9:48 ` Russell King (Oracle)
2026-03-24 9:20 ` [PATCH net-next 2/5] net: stmmac: dwmac-socfpga: Use the socfpga_sgmii_config() helper Maxime Chevallier
2026-03-24 9:48 ` Russell King (Oracle)
2026-03-24 9:20 ` [PATCH net-next 3/5] net: stmmac: dwmac-socfpga: Use the correct type for interface modes Maxime Chevallier
2026-03-24 9:49 ` Russell King (Oracle)
2026-03-24 9:20 ` [PATCH net-next 4/5] net: stmmac: dwmac-socfpga: get the phy_mode with the dedicated helper Maxime Chevallier
2026-03-24 9:51 ` Russell King (Oracle)
2026-03-24 9:21 ` [PATCH net-next 5/5] net: stmmac: dwmac-sofcpga: Drop the struct device reference Maxime Chevallier
2026-03-24 9:53 ` Russell King (Oracle) [this message]
2026-03-27 1:32 ` [PATCH net-next 0/5] net: stmmac: dwmac-socfpga: Cleanup .fix_mac_speed patchwork-bot+netdevbpf
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=acJfEfLzOLYN9qJ_@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=alexandre.torgue@foss.st.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--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=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mun.yew.tham@altera.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rohan.g.thomas@altera.com \
--cc=thomas.petazzoni@bootlin.com \
/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