| From 90c9f12af837b6abfe59a523af195c77f699bcd7 Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Mon, 12 Feb 2018 14:42:36 +0100 |
| Subject: [PATCH 0480/1795] sh_eth: Remove obsolete explicit clock handling for |
| WoL |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| Currently, if Wake-on-LAN is enabled, the SH-ETH device's module clock |
| is manually kept running during system suspend, to make sure the device |
| stays active. |
| |
| Since commits 91c719f5ec6671f7 ("soc: renesas: rcar-sysc: Keep wakeup |
| sources active during system suspend") and 744dddcae84441b1 ("clk: |
| renesas: mstp: Keep wakeup sources active during system suspend"), this |
| workaround is no longer needed. Hence remove all explicit clock |
| handling to keep the device active. |
| |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> |
| Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| (cherry picked from commit b4580c952e89a332f077038ef19a7582950c082d) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/net/ethernet/renesas/sh_eth.c | 18 +++--------------- |
| 1 file changed, 3 insertions(+), 15 deletions(-) |
| |
| diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c |
| index f17cb74c03e9..cffd58af7c45 100644 |
| --- a/drivers/net/ethernet/renesas/sh_eth.c |
| +++ b/drivers/net/ethernet/renesas/sh_eth.c |
| @@ -40,7 +40,6 @@ |
| #include <linux/slab.h> |
| #include <linux/ethtool.h> |
| #include <linux/if_vlan.h> |
| -#include <linux/clk.h> |
| #include <linux/sh_eth.h> |
| #include <linux/of_mdio.h> |
| |
| @@ -2281,7 +2280,7 @@ static void sh_eth_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) |
| wol->supported = 0; |
| wol->wolopts = 0; |
| |
| - if (mdp->cd->magic && mdp->clk) { |
| + if (mdp->cd->magic) { |
| wol->supported = WAKE_MAGIC; |
| wol->wolopts = mdp->wol_enabled ? WAKE_MAGIC : 0; |
| } |
| @@ -2291,7 +2290,7 @@ static int sh_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) |
| { |
| struct sh_eth_private *mdp = netdev_priv(ndev); |
| |
| - if (!mdp->cd->magic || !mdp->clk || wol->wolopts & ~WAKE_MAGIC) |
| + if (!mdp->cd->magic || wol->wolopts & ~WAKE_MAGIC) |
| return -EOPNOTSUPP; |
| |
| mdp->wol_enabled = !!(wol->wolopts & WAKE_MAGIC); |
| @@ -3130,11 +3129,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev) |
| goto out_release; |
| } |
| |
| - /* Get clock, if not found that's OK but Wake-On-Lan is unavailable */ |
| - mdp->clk = devm_clk_get(&pdev->dev, NULL); |
| - if (IS_ERR(mdp->clk)) |
| - mdp->clk = NULL; |
| - |
| ndev->base_addr = res->start; |
| |
| spin_lock_init(&mdp->lock); |
| @@ -3255,7 +3249,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) |
| if (ret) |
| goto out_napi_del; |
| |
| - if (mdp->cd->magic && mdp->clk) |
| + if (mdp->cd->magic) |
| device_set_wakeup_capable(&pdev->dev, 1); |
| |
| /* print device information */ |
| @@ -3308,9 +3302,6 @@ static int sh_eth_wol_setup(struct net_device *ndev) |
| /* Enable MagicPacket */ |
| sh_eth_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE); |
| |
| - /* Increased clock usage so device won't be suspended */ |
| - clk_enable(mdp->clk); |
| - |
| return enable_irq_wake(ndev->irq); |
| } |
| |
| @@ -3336,9 +3327,6 @@ static int sh_eth_wol_restore(struct net_device *ndev) |
| if (ret < 0) |
| return ret; |
| |
| - /* Restore clock usage count */ |
| - clk_disable(mdp->clk); |
| - |
| return disable_irq_wake(ndev->irq); |
| } |
| |
| -- |
| 2.19.0 |
| |