[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240105082339.1468817-15-claudiu.beznea.uj@bp.renesas.com>
Date: Fri, 5 Jan 2024 10:23:34 +0200
From: Claudiu <claudiu.beznea@...on.dev>
To: s.shtylyov@....ru,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
richardcochran@...il.com,
p.zabel@...gutronix.de,
yoshihiro.shimoda.uh@...esas.com,
wsa+renesas@...g-engineering.com
Cc: netdev@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
linux-kernel@...r.kernel.org,
claudiu.beznea@...on.dev,
geert+renesas@...der.be,
Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: [PATCH net-next v3 14/19] net: ravb: Simplify ravb_suspend()
From: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
As ravb_close() contains now the call to ravb_ptp_stop() for both ccc_gac
and gPTP aware platforms, there is no need to keep the separate call in
ravb_suspend(). Instead, move it to ravb_wol_setup(). In this way the
resulting code is cleaner.
Reviewed-by: Sergey Shtylyov <s.shtylyov@....ru>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
---
Changes in v3:
- fixed typos in patch description
- collected tags
Changes in v2:
- none; this patch is new
drivers/net/ethernet/renesas/ravb_main.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 434b4777de5e..1d228e0d875f 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2890,6 +2890,9 @@ static int ravb_wol_setup(struct net_device *ndev)
/* Enable MagicPacket */
ravb_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE);
+ if (priv->info->ccc_gac)
+ ravb_ptp_stop(ndev);
+
return enable_irq_wake(priv->emac_irq);
}
@@ -2922,14 +2925,10 @@ static int ravb_suspend(struct device *dev)
netif_device_detach(ndev);
if (priv->wol_enabled)
- ret = ravb_wol_setup(ndev);
- else
- ret = ravb_close(ndev);
+ return ravb_wol_setup(ndev);
- if (priv->info->ccc_gac)
- ravb_ptp_stop(ndev);
-
- if (priv->wol_enabled)
+ ret = ravb_close(ndev);
+ if (ret)
return ret;
reset_assert:
--
2.39.2
Powered by blists - more mailing lists