]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: ravb: Simplify ravb_suspend()
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Fri, 2 Feb 2024 08:41:35 +0000 (10:41 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 6 Feb 2024 10:14:57 +0000 (11:14 +0100)
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.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/renesas/ravb_main.c

index 0dab98ea615a10bb772b8a17761e4b309c21624a..661236affa5b464eafa797c68eded237036a32db 100644 (file)
@@ -2929,6 +2929,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);
 }
 
@@ -2961,14 +2964,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: