Skip to content

Commit 6d6d6cc

Browse files
claudiubezneaAndrei Simion
authored andcommitted
net: phylink: add helper to initialize phylink's phydev
Add helper to initalize phydev embedded in a phylink object. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
1 parent 9d18fbf commit 6d6d6cc

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/net/phy/phylink.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,6 +2726,16 @@ int phylink_ethtool_set_eee(struct phylink *pl, struct ethtool_eee *eee)
27262726
}
27272727
EXPORT_SYMBOL_GPL(phylink_ethtool_set_eee);
27282728

2729+
/**
2730+
* phylink_init_phydev() - initialize phydev associated to phylink
2731+
* @pl: a pointer to a &struct phylink returned from phylink_create()
2732+
*/
2733+
int phylink_init_phydev(struct phylink *pl)
2734+
{
2735+
return phy_init_hw(pl->phydev);
2736+
}
2737+
EXPORT_SYMBOL_GPL(phylink_init_phydev);
2738+
27292739
/* This emulates MII registers for a fixed-mode phy operating as per the
27302740
* passed in state. "aneg" defines if we report negotiation is possible.
27312741
*

include/linux/phylink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,7 @@ int phylink_ethtool_set_eee(struct phylink *, struct ethtool_eee *);
689689
int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
690690
int phylink_speed_down(struct phylink *pl, bool sync);
691691
int phylink_speed_up(struct phylink *pl);
692+
int phylink_init_phydev(struct phylink *pl);
692693

693694
#define phylink_zero(bm) \
694695
bitmap_zero(bm, __ETHTOOL_LINK_MODE_MASK_NBITS)

0 commit comments

Comments
 (0)