Skip to content

Commit 0a62964

Browse files
ffainellidavem330
authored andcommitted
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>
1 parent 7268586 commit 0a62964

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

drivers/net/phy/phylink.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,14 +731,16 @@ EXPORT_SYMBOL_GPL(phylink_connect_phy);
731731
* phylink_of_phy_connect() - connect the PHY specified in the DT mode.
732732
* @pl: a pointer to a &struct phylink returned from phylink_create()
733733
* @dn: a pointer to a &struct device_node.
734+
* @flags: PHY-specific flags to communicate to the PHY device driver
734735
*
735736
* Connect the phy specified in the device node @dn to the phylink instance
736737
* specified by @pl. Actions specified in phylink_connect_phy() will be
737738
* performed.
738739
*
739740
* Returns 0 on success or a negative errno.
740741
*/
741-
int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn)
742+
int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn,
743+
u32 flags)
742744
{
743745
struct device_node *phy_node;
744746
struct phy_device *phy_dev;
@@ -764,7 +766,8 @@ int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn)
764766
return 0;
765767
}
766768

767-
phy_dev = of_phy_attach(pl->netdev, phy_node, 0, pl->link_interface);
769+
phy_dev = of_phy_attach(pl->netdev, phy_node, flags,
770+
pl->link_interface);
768771
/* We're done with the phy_node handle */
769772
of_node_put(phy_node);
770773

include/linux/phylink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ struct phylink *phylink_create(struct net_device *, struct fwnode_handle *,
188188
void phylink_destroy(struct phylink *);
189189

190190
int phylink_connect_phy(struct phylink *, struct phy_device *);
191-
int phylink_of_phy_connect(struct phylink *, struct device_node *);
191+
int phylink_of_phy_connect(struct phylink *, struct device_node *, u32 flags);
192192
void phylink_disconnect_phy(struct phylink *);
193193

194194
void phylink_mac_change(struct phylink *, bool up);

0 commit comments

Comments
 (0)