[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230721110345.3925719-2-m.felsch@pengutronix.de>
Date: Fri, 21 Jul 2023 13:03:44 +0200
From: Marco Felsch <m.felsch@...gutronix.de>
To: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org,
conor+dt@...nel.org,
peppe.cavallaro@...com,
alexandre.torgue@...s.st.com,
joabreu@...opsys.com,
mcoquelin.stm32@...il.com
Cc: devicetree@...r.kernel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
kernel@...gutronix.de,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH net-next v4 2/3] net: stmmac: introduce small helper to check STMMAC_FLAG_USE_PHY_WOL
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@...gutronix.de>
---
Changelog:
v4:
- new patch
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
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 =
--
2.39.2
Powered by blists - more mailing lists