1 From 095ef388f714d622aa503fcccf20dc4095b72762 Mon Sep 17 00:00:00 2001
2 From: Vladimir Oltean <vladimir.oltean@nxp.com>
3 Date: Tue, 29 Nov 2022 16:12:13 +0200
4 Subject: [PATCH 06/14] net: dpaa2-mac: remove defensive check in
7 dpaa2_mac_disconnect() will only be called with a NULL mac->phylink if
8 dpaa2_mac_connect() failed, or was never called.
10 The callers are these:
12 dpaa2_eth_disconnect_mac():
14 if (dpaa2_eth_is_type_phy(priv))
15 dpaa2_mac_disconnect(priv->mac);
17 dpaa2_switch_port_disconnect_mac():
19 if (dpaa2_switch_port_is_type_phy(port_priv))
20 dpaa2_mac_disconnect(port_priv->mac);
22 priv->mac can be NULL, but in that case, dpaa2_eth_is_type_phy() returns
23 false, and dpaa2_mac_disconnect() is never called. Similar for
26 When priv->mac is non-NULL, it means that dpaa2_mac_connect() returned
27 zero (success), and therefore, priv->mac->phylink is also a valid
30 Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
31 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
32 Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
33 Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
34 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
36 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 3 ---
37 1 file changed, 3 deletions(-)
39 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
40 +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
41 @@ -446,9 +446,6 @@ err_pcs_destroy:
43 void dpaa2_mac_disconnect(struct dpaa2_mac *mac)
48 phylink_disconnect_phy(mac->phylink);
49 phylink_destroy(mac->phylink);
50 dpaa2_pcs_destroy(mac);