@@ -1558,7 +1558,7 @@ static struct phylink_pcs *
1558
1558
dsa_port_phylink_mac_select_pcs (struct phylink_config * config ,
1559
1559
phy_interface_t interface )
1560
1560
{
1561
- struct dsa_port * dp = container_of (config , struct dsa_port , pl_config );
1561
+ struct dsa_port * dp = dsa_phylink_to_port (config );
1562
1562
struct phylink_pcs * pcs = ERR_PTR (- EOPNOTSUPP );
1563
1563
struct dsa_switch * ds = dp -> ds ;
1564
1564
@@ -1572,7 +1572,7 @@ static int dsa_port_phylink_mac_prepare(struct phylink_config *config,
1572
1572
unsigned int mode ,
1573
1573
phy_interface_t interface )
1574
1574
{
1575
- struct dsa_port * dp = container_of (config , struct dsa_port , pl_config );
1575
+ struct dsa_port * dp = dsa_phylink_to_port (config );
1576
1576
struct dsa_switch * ds = dp -> ds ;
1577
1577
int err = 0 ;
1578
1578
@@ -1587,7 +1587,7 @@ static void dsa_port_phylink_mac_config(struct phylink_config *config,
1587
1587
unsigned int mode ,
1588
1588
const struct phylink_link_state * state )
1589
1589
{
1590
- struct dsa_port * dp = container_of (config , struct dsa_port , pl_config );
1590
+ struct dsa_port * dp = dsa_phylink_to_port (config );
1591
1591
struct dsa_switch * ds = dp -> ds ;
1592
1592
1593
1593
if (!ds -> ops -> phylink_mac_config )
@@ -1600,7 +1600,7 @@ static int dsa_port_phylink_mac_finish(struct phylink_config *config,
1600
1600
unsigned int mode ,
1601
1601
phy_interface_t interface )
1602
1602
{
1603
- struct dsa_port * dp = container_of (config , struct dsa_port , pl_config );
1603
+ struct dsa_port * dp = dsa_phylink_to_port (config );
1604
1604
struct dsa_switch * ds = dp -> ds ;
1605
1605
int err = 0 ;
1606
1606
@@ -1615,7 +1615,7 @@ static void dsa_port_phylink_mac_link_down(struct phylink_config *config,
1615
1615
unsigned int mode ,
1616
1616
phy_interface_t interface )
1617
1617
{
1618
- struct dsa_port * dp = container_of (config , struct dsa_port , pl_config );
1618
+ struct dsa_port * dp = dsa_phylink_to_port (config );
1619
1619
struct phy_device * phydev = NULL ;
1620
1620
struct dsa_switch * ds = dp -> ds ;
1621
1621
@@ -1638,7 +1638,7 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config,
1638
1638
int speed , int duplex ,
1639
1639
bool tx_pause , bool rx_pause )
1640
1640
{
1641
- struct dsa_port * dp = container_of (config , struct dsa_port , pl_config );
1641
+ struct dsa_port * dp = dsa_phylink_to_port (config );
1642
1642
struct dsa_switch * ds = dp -> ds ;
1643
1643
1644
1644
if (!ds -> ops -> phylink_mac_link_up ) {
0 commit comments