net: phy: remove support for deprecated array-style fixed-link binding
Subsystems (7)
Heiner Kallweit
maintainerv2 cover net: phy: remove support for deprecated array-style fixed-link binding
The array-style fixed-link binding has been marked deprecated for more than 10 yrs. See e.g. 91c1d980d601 ("Documentation: devicetree: add old and deprecated 'fixed-link'") from 2014.
So migrate the remaining few in-kernel users of the old binding, and remove for it.
v2:
- fix "Properties must precede subnodes" error in patches 1 and 2
Heiner Kallweit (5):
arm64: dts: ls1043a-qds: switch to new fixed-link binding
ARM: dts: ls1021a: switch to new fixed-link binding
ARM: dts: st: switch to new fixed-link binding
net: mdio: remove support for old fixed-link binding
net: phy: phylink: remove support for deprecated fixed-link binding
arch/arm/boot/dts/nxp/ls/ls1021a-iot.dts | 5 +++- arch/arm/boot/dts/st/stih418-b2199.dts | 5 +++- arch/arm/boot/dts/st/stihxxx-b2120.dtsi | 5 +++- .../boot/dts/freescale/fsl-ls1043a-qds.dts | 5 +++- drivers/net/mdio/of_mdio.c | 26 ------------------- drivers/net/phy/phylink.c | 25 +----------------- 6 files changed, 17 insertions(+), 54 deletions(-)
Signature · 1 line
2.51.0
Heiner Kallweit
maintainerPATCH v2 1/5 arm64: dts: ls1043a-qds: switch to new fixed-link binding
The old array-type fixed-link binding has been deprecated for more than 10 yrs. Switch to the new binding.
---
v2:
- fix "Properties must precede subnodes" error
--- arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts +4 -1
@@ -205,8 +205,11 @@ ethernet@ea000 { }; ethernet@f0000 { /* DTSEC9/10GEC1 */ - fixed-link = <1 1 10000 0 0>; phy-connection-type = "xgmii"; + fixed-link { + speed = <10000>; + full-duplex; + }; }; };
Signature · 1 line
2.51.0
Heiner Kallweit
maintainerPATCH v2 2/5 ARM: dts: ls1021a: switch to new fixed-link binding
In reply to Heiner KallweitThe old array-type fixed-link binding has been deprecated for more than 10 yrs. Switch to the new binding.
---
v2:
- fix "Properties must precede subnodes" error
--- arch/arm/boot/dts/nxp/ls/ls1021a-iot.dts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/boot/dts/nxp/ls/ls1021a-iot.dts +4 -1
@@ -120,9 +120,12 @@ &enet1 { }; &enet2 { - fixed-link = <0 1 1000 0 0>; phy-connection-type = "rgmii-id"; status = "okay"; + fixed-link { + speed = <1000>; + full-duplex; + }; }; &esdhc {
Signature · 1 line
2.51.0
Heiner Kallweit
maintainerPATCH v2 3/5 ARM: dts: st: switch to new fixed-link binding
In reply to Heiner KallweitThe old array-type fixed-link binding has been deprecated for more than 10 yrs. Switch to the new binding.
--- arch/arm/boot/dts/st/stih418-b2199.dts | 5 ++++- arch/arm/boot/dts/st/stihxxx-b2120.dtsi | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)
arch/arm/boot/dts/st/stih418-b2199.dts +4 -1
@@ -103,7 +103,10 @@ ethernet0: dwmac@9630000 { st,tx-retime-src = "clkgen"; status = "okay"; phy-mode = "rgmii"; - fixed-link = <0 1 1000 0 0>; + fixed-link { + speed = <1000>; + full-duplex; + }; }; }; };
arch/arm/boot/dts/st/stihxxx-b2120.dtsi +4 -1
@@ -147,7 +147,10 @@ ethernet0: dwmac@9630000 { st,tx-retime-src = "clkgen"; status = "okay"; phy-mode = "rgmii"; - fixed-link = <0 1 1000 0 0>; + fixed-link { + speed = <1000>; + full-duplex; + }; }; demux@8a20000 {
Signature · 1 line
2.51.0
Heiner Kallweit
maintainerPATCH v2 4/5 net: mdio: remove support for old fixed-link binding
In reply to Heiner KallweitThe old array-type fixed-link binding has been deprecated for more than 10 yrs. So remove support for it.
--- drivers/net/mdio/of_mdio.c | 26 -------------------------- 1 file changed, 26 deletions(-)
drivers/net/mdio/of_mdio.c +0 -26
@@ -379,21 +379,12 @@ struct phy_device *of_phy_get_and_connect(struct net_device *dev, }EXPORT_SYMBOL (of_phy_get_and_connect); -/* -* of_phy_is_fixed_link() and of_phy_register_fixed_link() must -* support two DT bindings: -* - the old DT binding, where 'fixed-link' was a property with 5 -* cells encoding various information about the fixed PHY -* - the new DT binding, where 'fixed-link' is a sub-node of the -* Ethernet device. -*/ bool of_phy_is_fixed_link (struct device_node *np) {struct device_node *dn;int err;const char *managed; -/* New binding */ dn =of_get_child_by_name (np,"fixed-link" );if (dn) {of_node_put (dn);
@@ -404,10 +395,6 @@ bool of_phy_is_fixed_link(struct device_node *np)if (err ==0 &&strcmp (managed,"auto" ) !=0 )return true; -/* Old binding */ -if (of_property_count_u32_elems (np,"fixed-link" ) ==5 ) -return true; -return false; }EXPORT_SYMBOL (of_phy_is_fixed_link);
@@ -416,7 +403,6 @@ int of_phy_register_fixed_link(struct device_node *np) {struct fixed_phy_status status = {};struct device_node *fixed_link_node; -u32 fixed_link_prop[5 ];const char *managed; if (of_property_read_string(np, "managed", &managed) == 0 &&
@@ -425,7 +411,6 @@ int of_phy_register_fixed_link(struct device_node *np) goto register_phy; } -/* New binding */ fixed_link_node =of_get_child_by_name (np,"fixed-link" );if (fixed_link_node) { status.link =1 ;
@@ -444,17 +429,6 @@ int of_phy_register_fixed_link(struct device_node *np) goto register_phy; } -/* Old binding */ -if (of_property_read_u32_array (np,"fixed-link" , fixed_link_prop, -ARRAY_SIZE (fixed_link_prop)) ==0 ) { - status.link =1 ; - status.duplex = fixed_link_prop[1 ]; - status.speed = fixed_link_prop[2 ]; - status.pause = fixed_link_prop[3 ]; - status.asym_pause = fixed_link_prop[4 ]; - goto register_phy; - } -return -ENODEV ; register_phy:
Signature · 1 line
2.51.0
Heiner Kallweit
maintainerPATCH v2 5/5 net: phy: phylink: remove support for deprecated fixed-link binding
In reply to Heiner KallweitThe old array-type fixed-link binding has been deprecated for more than 10 yrs. So remove support for it.
--- drivers/net/phy/phylink.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-)
drivers/net/phy/phylink.c +1 -24
@@ -690,29 +690,6 @@ static int phylink_parse_fixedlink(struct phylink *pl,if (ret)return ret; - }else { -u32 prop[5 ]; - - ret =fwnode_property_read_u32_array (fwnode,"fixed-link" , -NULL ,0 ); -if (ret !=ARRAY_SIZE (prop)) { -phylink_err (pl,"broken fixed-link?\n" ); -return -EINVAL ; - } - - ret =fwnode_property_read_u32_array (fwnode,"fixed-link" , - prop,ARRAY_SIZE (prop)); -if (!ret) { - pl->link_config.duplex = prop[1 ] ? -DUPLEX_FULL :DUPLEX_HALF ; - pl->link_config.speed = prop[2 ]; -if (prop[3 ]) -__set_bit (ETHTOOL_LINK_MODE_Pause_BIT, - pl->link_config.lp_advertising); -if (prop[4 ]) -__set_bit (ETHTOOL_LINK_MODE_Asym_Pause_BIT, - pl->link_config.lp_advertising); - } } if (pl->link_config.speed > SPEED_1000 &&
@@ -768,7 +745,7 @@ static int phylink_parse_mode(struct phylink *pl, pl->cfg_link_an_mode =MLO_AN_INBAND ; dn =fwnode_get_named_child_node (fwnode,"fixed-link" ); -if (dn ||fwnode_property_present (fwnode,"fixed-link" )) +if (dn) pl->cfg_link_an_mode =MLO_AN_FIXED ;fwnode_handle_put (dn);
Signature · 1 line
2.51.0
Heiner Kallweit
maintainerQuoted 17 lines · Heiner Kallweit
The array-style fixed-link binding has been marked deprecated for more than 10 yrs. See e.g.
91c1d980d601("Documentation: devicetree: add old and deprecated 'fixed-link'") from 2014.So migrate the remaining few in-kernel users of the old binding, and remove for it.
v2:
- fix "Properties must precede subnodes" error in patches 1 and 2Heiner Kallweit (5):
arm64: dts: ls1043a-qds: switch to new fixed-link binding
ARM: dts: ls1021a: switch to new fixed-link binding
ARM: dts: st: switch to new fixed-link binding
net: mdio: remove support for old fixed-link binding
net: phy: phylink: remove support for deprecated fixed-link binding
Quoted 8 lines
arch/arm/boot/dts/nxp/ls/ls1021a-iot.dts | 5 +++- arch/arm/boot/dts/st/stih418-b2199.dts | 5 +++- arch/arm/boot/dts/st/stihxxx-b2120.dtsi | 5 +++- .../boot/dts/freescale/fsl-ls1043a-qds.dts | 5 +++- drivers/net/mdio/of_mdio.c | 26 ------------------- drivers/net/phy/phylink.c | 25 +----------------- 6 files changed, 17 insertions(+), 54 deletions(-)
--
pw-bot: cr