summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phylink.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-12-12 16:00:25 -0800
committerDavid S. Miller <davem@davemloft.net>2017-12-13 15:55:00 -0500
commit0a62964c9020208c08c8b0323db9ea0c5980876f (patch)
treee7f598988b1f565f66fe00db1ba47fd971ddfc1b /drivers/net/phy/phylink.c
parent7268586baa530312041e597b518b5c6a05110df1 (diff)
downloadlinux-0a62964c9020208c08c8b0323db9ea0c5980876f.tar.bz2
net: phy: phylink: Allow specifying PHY device flags
In order to let subsystems like DSA fully utilize PHYLINK, we need to be able to communicate phy_device::flags from of_phy_{connect,attach} even when using PHYLINK APIs. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r--drivers/net/phy/phylink.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 2bfb548d3dff..94b43c5237fa 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -731,6 +731,7 @@ EXPORT_SYMBOL_GPL(phylink_connect_phy);
* phylink_of_phy_connect() - connect the PHY specified in the DT mode.
* @pl: a pointer to a &struct phylink returned from phylink_create()
* @dn: a pointer to a &struct device_node.
+ * @flags: PHY-specific flags to communicate to the PHY device driver
*
* Connect the phy specified in the device node @dn to the phylink instance
* specified by @pl. Actions specified in phylink_connect_phy() will be
@@ -738,7 +739,8 @@ EXPORT_SYMBOL_GPL(phylink_connect_phy);
*
* Returns 0 on success or a negative errno.
*/
-int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn)
+int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn,
+ u32 flags)
{
struct device_node *phy_node;
struct phy_device *phy_dev;
@@ -764,7 +766,8 @@ int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn)
return 0;
}
- phy_dev = of_phy_attach(pl->netdev, phy_node, 0, pl->link_interface);
+ phy_dev = of_phy_attach(pl->netdev, phy_node, flags,
+ pl->link_interface);
/* We're done with the phy_node handle */
of_node_put(phy_node);