[net-next,08/12] net: dpaa2-switch replace direct MAC access with dpaa2_switch_port_has_mac()

Message ID 20221129141221.872653-9-vladimir.oltean@nxp.com
State New
Headers
Series Fix rtnl_mutex deadlock with DPAA2 and SFP modules |

Commit Message

Vladimir Oltean Nov. 29, 2022, 2:12 p.m. UTC
  The helper function will gain a lockdep annotation in a future patch.
Make sure to benefit from it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Andrew Lunn Nov. 29, 2022, 6:55 p.m. UTC | #1
On Tue, Nov 29, 2022 at 04:12:17PM +0200, Vladimir Oltean wrote:
> The helper function will gain a lockdep annotation in a future patch.
> Make sure to benefit from it.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

 Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
  

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c
index 40ee57ef55be..76a4b09e2854 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c
@@ -189,7 +189,7 @@  static void dpaa2_switch_ethtool_get_stats(struct net_device *netdev,
 				   dpaa2_switch_ethtool_counters[i].name, err);
 	}
 
-	if (port_priv->mac)
+	if (dpaa2_switch_port_has_mac(port_priv))
 		dpaa2_mac_get_ethtool_stats(port_priv->mac, data + i);
 }