Skip to contentSkip to conversation

net: phy: fixed_phy: simplify fixed_mdio_read

PATCH Applied Heiner Kallweit 3 participants 3 messages Aug 26, 2025 – Aug 28, 2025

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 net: phy: fixed_phy: simplify fixed_mdio_read

swphy_read_reg() doesn't change the passed struct fixed_phy_status, so we can pass &fp->status directly.

---
 drivers/net/phy/fixed_phy.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/phy/fixed_phy.c +1 -4
index 616dff089..7015c763a 100644
@@ -75,8 +75,6 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
 
 	list_for_each_entry(fp, &fmb->phys, node) {
 		if (fp->addr == phy_addr) {
-			struct fixed_phy_status state;
-
 			fp->status.link = !fp->no_carrier;
 
 			/* Issue callback if user registered it. */
@@ -86,9 +84,8 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
 
 			/* Check the GPIO for change in status */
 			fixed_phy_update(fp);
-			state = fp->status;
 
-			return swphy_read_reg(reg_num, &state);
+			return swphy_read_reg(reg_num, &fp->status);
 		}
 	}
 
Signature · 1 line
2.51.0
#2 lore raw
In reply to Heiner Kallweit
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 7 lines · On Tue, 26 Aug 2025 21:24:44 +0200 you wrote:

swphy_read_reg() doesn't change the passed struct fixed_phy_status, so we can pass &fp->status directly.

---
 drivers/net/phy/fixed_phy.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Here is the summary with links:
- [net-next] net: phy: fixed_phy: simplify fixed_mdio_read

    https://git.kernel.org/netdev/net-next/c/6aff3699906b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html