| From 6da0c0140db880075424d043c5ce6055421c3c74 Mon Sep 17 00:00:00 2001 |
| From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> |
| Date: Thu, 6 Jun 2013 09:52:37 +0000 |
| Subject: sh_eth: enclose PM code into #ifdef CONFIG_PM |
| |
| Put '#ifdef CONFIG_PM' around sh_eth_runtime_nop() and 'sh_eth_dev_pm_ops'. |
| Add '#define SH_ETH_PM_OPS' to facilitate initialization of driver's 'pm' field |
| depending on whether CONFIG_PM is enabled. |
| |
| Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> |
| [Sergei: added the changelog, reworded the subject, changing the prefix.] |
| Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| |
| (cherry picked from commit 540ad1b888ad9564520c1c8c48ad675f76ffce62) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/net/ethernet/renesas/sh_eth.c | 9 +++++++-- |
| 1 file changed, 7 insertions(+), 2 deletions(-) |
| |
| diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c |
| index cae8576a..0a7990a1 100644 |
| --- a/drivers/net/ethernet/renesas/sh_eth.c |
| +++ b/drivers/net/ethernet/renesas/sh_eth.c |
| @@ -2685,6 +2685,7 @@ static int sh_eth_drv_remove(struct platform_device *pdev) |
| return 0; |
| } |
| |
| +#ifdef CONFIG_PM |
| static int sh_eth_runtime_nop(struct device *dev) |
| { |
| /* |
| @@ -2698,17 +2699,21 @@ static int sh_eth_runtime_nop(struct device *dev) |
| return 0; |
| } |
| |
| -static struct dev_pm_ops sh_eth_dev_pm_ops = { |
| +static const struct dev_pm_ops sh_eth_dev_pm_ops = { |
| .runtime_suspend = sh_eth_runtime_nop, |
| .runtime_resume = sh_eth_runtime_nop, |
| }; |
| +#define SH_ETH_PM_OPS (&sh_eth_dev_pm_ops) |
| +#else |
| +#define SH_ETH_PM_OPS NULL |
| +#endif |
| |
| static struct platform_driver sh_eth_driver = { |
| .probe = sh_eth_drv_probe, |
| .remove = sh_eth_drv_remove, |
| .driver = { |
| .name = CARDNAME, |
| - .pm = &sh_eth_dev_pm_ops, |
| + .pm = SH_ETH_PM_OPS, |
| }, |
| }; |
| |
| -- |
| 1.8.4.3.gca3854a |
| |