diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-08-26 11:30:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-31 02:32:11 -0400 |
commit | 1ddcf41ff3ee790d19978f7bee1ab76a77a5eb7b (patch) | |
tree | e9e05ffd9d792b1ad55f59df49cec83472c0b8ed /drivers/net/ethernet/renesas/ravb_main.c | |
parent | 7ba9d103466e6c8568fae6db1e79bbfcc8f4a680 (diff) |
ravb: avoid unused function warnings
When CONFIG_PM_SLEEP is disabled, we get a couple of harmless warnings:
drivers/net/ethernet/renesas/ravb_main.c:2117:12: error: 'ravb_resume' defined but not used [-Werror=unused-function]
drivers/net/ethernet/renesas/ravb_main.c:2104:12: error: 'ravb_suspend' defined but not used [-Werror=unused-function]
The simplest solution here is to replace the #ifdef with __maybe_unused
annotations, which lets the compiler do the right thing by itself.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 0184165b2f42 ("ravb: add sleep PM suspend/resume support")
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas/ravb_main.c')
-rw-r--r-- | drivers/net/ethernet/renesas/ravb_main.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index cad23ba06904..630536bc72f9 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c | |||
@@ -2100,8 +2100,7 @@ static int ravb_remove(struct platform_device *pdev) | |||
2100 | return 0; | 2100 | return 0; |
2101 | } | 2101 | } |
2102 | 2102 | ||
2103 | #ifdef CONFIG_PM | 2103 | static int __maybe_unused ravb_suspend(struct device *dev) |
2104 | static int ravb_suspend(struct device *dev) | ||
2105 | { | 2104 | { |
2106 | struct net_device *ndev = dev_get_drvdata(dev); | 2105 | struct net_device *ndev = dev_get_drvdata(dev); |
2107 | int ret = 0; | 2106 | int ret = 0; |
@@ -2114,7 +2113,7 @@ static int ravb_suspend(struct device *dev) | |||
2114 | return ret; | 2113 | return ret; |
2115 | } | 2114 | } |
2116 | 2115 | ||
2117 | static int ravb_resume(struct device *dev) | 2116 | static int __maybe_unused ravb_resume(struct device *dev) |
2118 | { | 2117 | { |
2119 | struct net_device *ndev = dev_get_drvdata(dev); | 2118 | struct net_device *ndev = dev_get_drvdata(dev); |
2120 | struct ravb_private *priv = netdev_priv(ndev); | 2119 | struct ravb_private *priv = netdev_priv(ndev); |
@@ -2149,7 +2148,7 @@ static int ravb_resume(struct device *dev) | |||
2149 | return ret; | 2148 | return ret; |
2150 | } | 2149 | } |
2151 | 2150 | ||
2152 | static int ravb_runtime_nop(struct device *dev) | 2151 | static int __maybe_unused ravb_runtime_nop(struct device *dev) |
2153 | { | 2152 | { |
2154 | /* Runtime PM callback shared between ->runtime_suspend() | 2153 | /* Runtime PM callback shared between ->runtime_suspend() |
2155 | * and ->runtime_resume(). Simply returns success. | 2154 | * and ->runtime_resume(). Simply returns success. |
@@ -2166,17 +2165,12 @@ static const struct dev_pm_ops ravb_dev_pm_ops = { | |||
2166 | SET_RUNTIME_PM_OPS(ravb_runtime_nop, ravb_runtime_nop, NULL) | 2165 | SET_RUNTIME_PM_OPS(ravb_runtime_nop, ravb_runtime_nop, NULL) |
2167 | }; | 2166 | }; |
2168 | 2167 | ||
2169 | #define RAVB_PM_OPS (&ravb_dev_pm_ops) | ||
2170 | #else | ||
2171 | #define RAVB_PM_OPS NULL | ||
2172 | #endif | ||
2173 | |||
2174 | static struct platform_driver ravb_driver = { | 2168 | static struct platform_driver ravb_driver = { |
2175 | .probe = ravb_probe, | 2169 | .probe = ravb_probe, |
2176 | .remove = ravb_remove, | 2170 | .remove = ravb_remove, |
2177 | .driver = { | 2171 | .driver = { |
2178 | .name = "ravb", | 2172 | .name = "ravb", |
2179 | .pm = RAVB_PM_OPS, | 2173 | .pm = &ravb_dev_pm_ops, |
2180 | .of_match_table = ravb_match_table, | 2174 | .of_match_table = ravb_match_table, |
2181 | }, | 2175 | }, |
2182 | }; | 2176 | }; |