summaryrefslogtreecommitdiff
path: root/drivers/net/phy/fixed_phy.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2025-08-26 21:24:44 +0200
committerJakub Kicinski <kuba@kernel.org>2025-08-27 18:09:08 -0700
commit6aff3699906bd1017fd9017bed133681b0eb8a42 (patch)
tree44fdeb72078fe75505ef8b5e86a9bcad78f96c9e /drivers/net/phy/fixed_phy.c
parenta6bac1822931bc3c862c07d535ab4192582c023c (diff)
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 <hkallweit1@gmail.com> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com> Link: https://patch.msgid.link/c49195c7-a3a1-485c-baed-9b33740752de@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/fixed_phy.c')
-rw-r--r--drivers/net/phy/fixed_phy.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index f0e8a6c524ca..7f4e1a155a0f 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -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);
}
}