diff mbox series

[net-next,v4,2/3] net: stmmac: introduce small helper to check STMMAC_FLAG_USE_PHY_WOL

Message ID 20230721110345.3925719-2-m.felsch@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series [net-next,v4,1/3] dt-bindings: net: snps,dwmac: add phy-supply support | expand

Commit Message

Marco Felsch July 21, 2023, 11:03 a.m. UTC
Add a convenient helper to make it easier to check the
STMMAC_FLAG_USE_PHY_WOL flag which is useful for the follow up commit.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
Changelog:
v4:
- new patch

 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e7ca52f0d2f2d..add271ec8d801 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6949,6 +6949,11 @@  static void stmmac_service_task(struct work_struct *work)
 	clear_bit(STMMAC_SERVICE_SCHED, &priv->state);
 }
 
+static bool stmmac_use_phy_wol(struct stmmac_priv *priv)
+{
+	return priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL;
+}
+
 /**
  *  stmmac_hw_init - Init the MAC device
  *  @priv: driver private structure
@@ -6983,7 +6988,7 @@  static int stmmac_hw_init(struct stmmac_priv *priv)
 		 */
 		priv->plat->enh_desc = priv->dma_cap.enh_desc;
 		priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up &&
-				!(priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL);
+				!stmmac_use_phy_wol(priv);
 		priv->hw->pmt = priv->plat->pmt;
 		if (priv->dma_cap.hash_tb_sz) {
 			priv->hw->multicast_filter_bins =