]> Gentwo Git Trees - linux/.git/commit
net: phy: realtek: eliminate priv->phycr2 variable
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 17 Nov 2025 23:40:29 +0000 (01:40 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 20 Nov 2025 04:24:23 +0000 (20:24 -0800)
commit27033d06917758d47162581da7e9de8004049dee
treeaefbe263cb81705de8612e7ba8c986fda9e8378c
parent8e982441ba601d982dd0739972115d85ae01d99b
net: phy: realtek: eliminate priv->phycr2 variable

The RTL8211F(D)(I)-VD-CG PHY also has support for disabling the CLKOUT,
and we'd like to introduce the "realtek,clkout-disable" property for
that.

But it isn't done through the PHYCR2 register, and it becomes awkward to
have the driver pretend that it is. So just replace the machine-level
"u16 phycr2" variable with a logical "bool disable_clk_out", which
scales better to the other PHY as well.

The change is a complete functional equivalent. Before, if the device
tree property was absent, priv->phycr2 would contain the RTL8211F_CLKOUT_EN
bit as read from hardware. Now, we don't save priv->phycr2, but we just
don't call phy_modify_paged() on it. Also, we can simply call
phy_modify_paged() with the "set" argument to 0.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251117234033.345679-3-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/realtek/realtek_main.c