of: mdio: honor flags passed to of_phy_connect
Subsystems (3)
PATCH 1/1 of: mdio: honor flags passed to of_phy_connect
Commit f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach, connect, connect_direct}") removed the flags argument to the PHY library calls to: phy_{attach,connect,connect_direct}.
Most Device Tree aware drivers call of_phy_connect() with the flag argument set to 0, but some of them might want to set a different value there in order for the PHY driver to key a specific behavior based on the phy_device::dev_flags value.
Allow such drivers to set custom dev_flags as part of the of_phy_connect() call since of_phy_connect() does start the PHY state machine, it will call into the PHY driver config_init() callback which is usually where a specific phy_flags value is important.
---
David,
This is applicable to 3.9 and newer, thanks!
drivers/of/of_mdio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/of/of_mdio.c +2 -0
@@ -224,6 +224,8 @@ struct phy_device *of_phy_connect(struct net_device *dev,if (!phy)return NULL ; + phy->dev_flags = flags; +return phy_connect_direct (dev, phy, hndlr, iface) ?NULL : phy; }EXPORT_SYMBOL (of_phy_connect);
Signature · 1 line
1.9.1
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Tue, 16 Sep 2014 10:49:36 -0700
Quoted 9 lines
Commit
f9a8f83b04e0("net: phy: remove flags argument from phy_{attach, connect,connect_direct}") removed the flags argument to the PHY library calls to: phy_{attach,connect,connect_direct}.Most Device Tree aware drivers call
of_phy_connect()with the flag argument set to 0, but some of them might want to set a different value there in order for the PHY driver to key a specific behavior based on thephy_device::dev_flagsvalue.
Quoted 7 lines
Allow such drivers to set custom
dev_flagsas part of theof_phy_connect()call sinceof_phy_connect()does start the PHY state machine, it will call into the PHY driverconfig_init()callback which is usually where a specificphy_flagsvalue is important.Fixes f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach, connect, connect_direct}")Signed-off-by Florian Fainelli <[email protected]>
I do not see anyone passing non-zero in as the flags argument.
It is difficult for me to determine the impact of this patch, whether it should really go to 'net' and/or 'stable', etc. if you don't tell me who this could possibly break.
It's even worse when I do all of the searching around and cannot find a breakage case myself. :-/
Quoted 17 lines · David Miller
From: Florian Fainelli <[email protected]>
Date: Tue, 16 Sep 2014 10:49:36 -0700Quoted 14 lines
Commit
f9a8f83b04e0("net: phy: remove flags argument from phy_{attach, connect,connect_direct}") removed the flags argument to the PHY library calls to: phy_{attach,connect,connect_direct}.Most Device Tree aware drivers call
of_phy_connect()with the flag argument set to 0, but some of them might want to set a different value there in order for the PHY driver to key a specific behavior based on thephy_device::dev_flagsvalue.Allow such drivers to set custom
dev_flagsas part of theof_phy_connect()call sinceof_phy_connect()does start the PHY state machine, it will call into the PHY driverconfig_init()callback which is usually where a specificphy_flagsvalue is important.
Quoted 4 lines
Quoted 2 lines
Fixes f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach, connect, connect_direct}")Signed-off-by Florian Fainelli <[email protected]>I do not see anyone passing non-zero in as the flags argument.
Right, I have a follow-up patch that will pass non-zero, I will just submit everything at once so it is clear in what context and purpose this gets used.
Thanks!
Quoted 8 lines
It is difficult for me to determine the impact of this patch, whether it should really go to 'net' and/or 'stable', etc. if you don't tell me who this could possibly break.
It's even worse when I do all of the searching around and cannot find a breakage case myself. :-/
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Tue, 16 Sep 2014 13:47:08 -0700
Quoted 3 lines
Right, I have a follow-up patch that will pass non-zero, I will just submit everything at once so it is clear in what context and purpose this gets used.
That would work a lot better, thanks.