Commit 1ddcf41f authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller

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: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 0184165b ("ravb: add sleep PM suspend/resume support")
Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ba9d103
...@@ -2100,8 +2100,7 @@ static int ravb_remove(struct platform_device *pdev) ...@@ -2100,8 +2100,7 @@ static int ravb_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused ravb_suspend(struct device *dev)
static int ravb_suspend(struct device *dev)
{ {
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
int ret = 0; int ret = 0;
...@@ -2114,7 +2113,7 @@ static int ravb_suspend(struct device *dev) ...@@ -2114,7 +2113,7 @@ static int ravb_suspend(struct device *dev)
return ret; return ret;
} }
static int ravb_resume(struct device *dev) static int __maybe_unused ravb_resume(struct device *dev)
{ {
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct ravb_private *priv = netdev_priv(ndev); struct ravb_private *priv = netdev_priv(ndev);
...@@ -2149,7 +2148,7 @@ static int ravb_resume(struct device *dev) ...@@ -2149,7 +2148,7 @@ static int ravb_resume(struct device *dev)
return ret; return ret;
} }
static int ravb_runtime_nop(struct device *dev) static int __maybe_unused ravb_runtime_nop(struct device *dev)
{ {
/* Runtime PM callback shared between ->runtime_suspend() /* Runtime PM callback shared between ->runtime_suspend()
* and ->runtime_resume(). Simply returns success. * and ->runtime_resume(). Simply returns success.
...@@ -2166,17 +2165,12 @@ static const struct dev_pm_ops ravb_dev_pm_ops = { ...@@ -2166,17 +2165,12 @@ static const struct dev_pm_ops ravb_dev_pm_ops = {
SET_RUNTIME_PM_OPS(ravb_runtime_nop, ravb_runtime_nop, NULL) SET_RUNTIME_PM_OPS(ravb_runtime_nop, ravb_runtime_nop, NULL)
}; };
#define RAVB_PM_OPS (&ravb_dev_pm_ops)
#else
#define RAVB_PM_OPS NULL
#endif
static struct platform_driver ravb_driver = { static struct platform_driver ravb_driver = {
.probe = ravb_probe, .probe = ravb_probe,
.remove = ravb_remove, .remove = ravb_remove,
.driver = { .driver = {
.name = "ravb", .name = "ravb",
.pm = RAVB_PM_OPS, .pm = &ravb_dev_pm_ops,
.of_match_table = ravb_match_table, .of_match_table = ravb_match_table,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment