net: phy: fixed_phy: simplify fixed_mdio_read
Subsystems (3)
Heiner Kallweit
maintainerPATCH 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.
Signed-off-by Heiner Kallweit <[email protected]>
--- drivers/net/phy/fixed_phy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/phy/fixed_phy.c +1 -4
@@ -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
From: Heiner Kallweit <[email protected]>
Date: Tue, 26 Aug 2025 21:24:44 +0200
Quoted 4 lines
swphy_read_reg()doesn't change the passed structfixed_phy_status, so we can pass&fp->statusdirectly.Signed-off-by Heiner Kallweit <[email protected]>
Reviewed-by Alexander Lobakin <[email protected]>
Quoted 3 lines
--- drivers/net/phy/fixed_phy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Thanks,
Olek
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 structfixed_phy_status, so we can pass&fp->statusdirectly.Signed-off-by Heiner Kallweit <[email protected]>--- 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