diff mbox series

[v2,1/2] net: stmmac: dwmac-mediatek: Fix inverted handling of mediatek,mac-wol

Message ID 20241109-mediatek-mac-wol-noninverted-v2-1-0e264e213878@collabora.com (mailing list archive)
State New
Headers show
Series net: stmmac: dwmac-mediatek: Fix inverted logic for mediatek,mac-wol | expand

Commit Message

Nícolas F. R. A. Prado Nov. 9, 2024, 3:16 p.m. UTC
The mediatek,mac-wol property is being handled backwards to what is
described in the binding: it currently enables PHY WOL when the property
is present and vice versa. Invert the driver logic so it matches the
binding description.

Fixes: fd1d62d80ebc ("net: stmmac: replace the use_phy_wol field with a flag")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

AngeloGioacchino Del Regno Nov. 14, 2024, 9:26 a.m. UTC | #1
Il 09/11/24 16:16, Nícolas F. R. A. Prado ha scritto:
> The mediatek,mac-wol property is being handled backwards to what is
> described in the binding: it currently enables PHY WOL when the property
> is present and vice versa. Invert the driver logic so it matches the
> binding description.
> 
> Fixes: fd1d62d80ebc ("net: stmmac: replace the use_phy_wol field with a flag")
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index f8ca81675407ade786f2b9a38c63511a0b7fb705..c9636832a570a211a53f9480b0a8aec56509199f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -589,9 +589,9 @@  static int mediatek_dwmac_common_data(struct platform_device *pdev,
 
 	plat->mac_interface = priv_plat->phy_mode;
 	if (priv_plat->mac_wol)
-		plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
-	else
 		plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL;
+	else
+		plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
 	plat->riwt_off = 1;
 	plat->maxmtu = ETH_DATA_LEN;
 	plat->host_dma_width = priv_plat->variant->dma_bit_mask;