diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-02-12 08:42:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-12 11:46:23 -0500 |
commit | b4580c952e89a332f077038ef19a7582950c082d (patch) | |
tree | 5636508b37fd17bb7d49899cd1f6726636c9f5cc | |
parent | dd62c236c0fe1166d037485494ec5ff6545480eb (diff) |
sh_eth: Remove obsolete explicit clock handling for WoL
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>
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index a197e11f3a56..92dcf8717fc6 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/ethtool.h> | 41 | #include <linux/ethtool.h> |
42 | #include <linux/if_vlan.h> | 42 | #include <linux/if_vlan.h> |
43 | #include <linux/clk.h> | ||
44 | #include <linux/sh_eth.h> | 43 | #include <linux/sh_eth.h> |
45 | #include <linux/of_mdio.h> | 44 | #include <linux/of_mdio.h> |
46 | 45 | ||
@@ -2304,7 +2303,7 @@ static void sh_eth_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) | |||
2304 | wol->supported = 0; | 2303 | wol->supported = 0; |
2305 | wol->wolopts = 0; | 2304 | wol->wolopts = 0; |
2306 | 2305 | ||
2307 | if (mdp->cd->magic && mdp->clk) { | 2306 | if (mdp->cd->magic) { |
2308 | wol->supported = WAKE_MAGIC; | 2307 | wol->supported = WAKE_MAGIC; |
2309 | wol->wolopts = mdp->wol_enabled ? WAKE_MAGIC : 0; | 2308 | wol->wolopts = mdp->wol_enabled ? WAKE_MAGIC : 0; |
2310 | } | 2309 | } |
@@ -2314,7 +2313,7 @@ static int sh_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) | |||
2314 | { | 2313 | { |
2315 | struct sh_eth_private *mdp = netdev_priv(ndev); | 2314 | struct sh_eth_private *mdp = netdev_priv(ndev); |
2316 | 2315 | ||
2317 | if (!mdp->cd->magic || !mdp->clk || wol->wolopts & ~WAKE_MAGIC) | 2316 | if (!mdp->cd->magic || wol->wolopts & ~WAKE_MAGIC) |
2318 | return -EOPNOTSUPP; | 2317 | return -EOPNOTSUPP; |
2319 | 2318 | ||
2320 | mdp->wol_enabled = !!(wol->wolopts & WAKE_MAGIC); | 2319 | mdp->wol_enabled = !!(wol->wolopts & WAKE_MAGIC); |
@@ -3153,11 +3152,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev) | |||
3153 | goto out_release; | 3152 | goto out_release; |
3154 | } | 3153 | } |
3155 | 3154 | ||
3156 | /* Get clock, if not found that's OK but Wake-On-Lan is unavailable */ | ||
3157 | mdp->clk = devm_clk_get(&pdev->dev, NULL); | ||
3158 | if (IS_ERR(mdp->clk)) | ||
3159 | mdp->clk = NULL; | ||
3160 | |||
3161 | ndev->base_addr = res->start; | 3155 | ndev->base_addr = res->start; |
3162 | 3156 | ||
3163 | spin_lock_init(&mdp->lock); | 3157 | spin_lock_init(&mdp->lock); |
@@ -3278,7 +3272,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) | |||
3278 | if (ret) | 3272 | if (ret) |
3279 | goto out_napi_del; | 3273 | goto out_napi_del; |
3280 | 3274 | ||
3281 | if (mdp->cd->magic && mdp->clk) | 3275 | if (mdp->cd->magic) |
3282 | device_set_wakeup_capable(&pdev->dev, 1); | 3276 | device_set_wakeup_capable(&pdev->dev, 1); |
3283 | 3277 | ||
3284 | /* print device information */ | 3278 | /* print device information */ |
@@ -3331,9 +3325,6 @@ static int sh_eth_wol_setup(struct net_device *ndev) | |||
3331 | /* Enable MagicPacket */ | 3325 | /* Enable MagicPacket */ |
3332 | sh_eth_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE); | 3326 | sh_eth_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE); |
3333 | 3327 | ||
3334 | /* Increased clock usage so device won't be suspended */ | ||
3335 | clk_enable(mdp->clk); | ||
3336 | |||
3337 | return enable_irq_wake(ndev->irq); | 3328 | return enable_irq_wake(ndev->irq); |
3338 | } | 3329 | } |
3339 | 3330 | ||
@@ -3359,9 +3350,6 @@ static int sh_eth_wol_restore(struct net_device *ndev) | |||
3359 | if (ret < 0) | 3350 | if (ret < 0) |
3360 | return ret; | 3351 | return ret; |
3361 | 3352 | ||
3362 | /* Restore clock usage count */ | ||
3363 | clk_disable(mdp->clk); | ||
3364 | |||
3365 | return disable_irq_wake(ndev->irq); | 3353 | return disable_irq_wake(ndev->irq); |
3366 | } | 3354 | } |
3367 | 3355 | ||