Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed01653

Browse files
committed
net: phylink: add helper to initialize phylink's phydev
Add helper to initalize phydev embedded in a phylink object. Signed-off-by: Claudiu Beznea <[email protected]>
1 parent bf0ad18 commit ed01653

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/net/phy/phylink.c

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

1898+
/**
1899+
* phylink_init_phydev() - initialize phydev associated to phylink
1900+
* @pl: a pointer to a &struct phylink returned from phylink_create()
1901+
*/
1902+
int phylink_init_phydev(struct phylink *pl)
1903+
{
1904+
return phy_init_hw(pl->phydev);
1905+
}
1906+
EXPORT_SYMBOL_GPL(phylink_init_phydev);
1907+
18981908
/* This emulates MII registers for a fixed-mode phy operating as per the
18991909
* passed in state. "aneg" defines if we report negotiation is possible.
19001910
*

include/linux/phylink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ int phylink_ethtool_set_eee(struct phylink *, struct ethtool_eee *);
475475
int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
476476
int phylink_speed_down(struct phylink *pl, bool sync);
477477
int phylink_speed_up(struct phylink *pl);
478+
int phylink_init_phydev(struct phylink *pl);
478479

479480
#define phylink_zero(bm) \
480481
bitmap_zero(bm, __ETHTOOL_LINK_MODE_MASK_NBITS)

0 commit comments

Comments
 (0)