1 From 97c07369ab8bf9895e05d4b468f18e6567263154 Mon Sep 17 00:00:00 2001
2 From: Vladimir Oltean <vladimir.oltean@nxp.com>
3 Date: Tue, 29 Nov 2022 16:12:12 +0200
4 Subject: [PATCH 05/14] net: dpaa2-mac: absorb phylink_start() call into
7 The phylink handling is intended to be hidden inside the dpaa2_mac
8 object. Move the phylink_start() call into dpaa2_mac_start(), and
9 phylink_stop() into dpaa2_mac_stop().
11 Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
12 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
13 Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
14 Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
15 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
17 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 5 +----
18 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 8 ++++++++
19 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 5 +----
20 3 files changed, 10 insertions(+), 8 deletions(-)
22 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
23 +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
24 @@ -2083,10 +2083,8 @@ static int dpaa2_eth_open(struct net_dev
28 - if (dpaa2_eth_is_type_phy(priv)) {
29 + if (dpaa2_eth_is_type_phy(priv))
30 dpaa2_mac_start(priv->mac);
31 - phylink_start(priv->mac->phylink);
36 @@ -2160,7 +2158,6 @@ static int dpaa2_eth_stop(struct net_dev
39 if (dpaa2_eth_is_type_phy(priv)) {
40 - phylink_stop(priv->mac->phylink);
41 dpaa2_mac_stop(priv->mac);
43 netif_tx_stop_all_queues(net_dev);
44 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
45 +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
46 @@ -336,12 +336,20 @@ static void dpaa2_mac_set_supported_inte
48 void dpaa2_mac_start(struct dpaa2_mac *mac)
53 phy_power_on(mac->serdes_phy);
55 + phylink_start(mac->phylink);
58 void dpaa2_mac_stop(struct dpaa2_mac *mac)
62 + phylink_stop(mac->phylink);
65 phy_power_off(mac->serdes_phy);
67 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
68 +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
69 @@ -703,10 +703,8 @@ static int dpaa2_switch_port_open(struct
71 dpaa2_switch_enable_ctrl_if_napi(ethsw);
73 - if (dpaa2_switch_port_is_type_phy(port_priv)) {
74 + if (dpaa2_switch_port_is_type_phy(port_priv))
75 dpaa2_mac_start(port_priv->mac);
76 - phylink_start(port_priv->mac->phylink);
81 @@ -718,7 +716,6 @@ static int dpaa2_switch_port_stop(struct
84 if (dpaa2_switch_port_is_type_phy(port_priv)) {
85 - phylink_stop(port_priv->mac->phylink);
86 dpaa2_mac_stop(port_priv->mac);
88 netif_tx_stop_all_queues(netdev);