Commit 66174b69 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Felipe Balbi

usb: dwc3: of-simple: avoid unused function warnings

An incorrect #ifdef caused a pair of harmless warnings when CONFIG_PM_SLEEP
is disabled:

drivers/usb/dwc3/dwc3-of-simple.c:223:12: error: 'dwc3_of_simple_resume' defined but not used [-Werror=unused-function]
 static int dwc3_of_simple_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~
drivers/usb/dwc3/dwc3-of-simple.c:213:12: error: 'dwc3_of_simple_suspend' defined but not used [-Werror=unused-function]
 static int dwc3_of_simple_suspend(struct device *dev)

Since the #ifdef method is generally hard to get right, use
a simpler __maybe_unused annotation here to let the compiler
drop the unused functions silently. This also improves
compile-time coverage.

Fixes: 76251db8 ("usb: dwc3: of-simple: reset host controller at suspend/resume")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 5b394b2d
...@@ -180,8 +180,7 @@ static int dwc3_of_simple_remove(struct platform_device *pdev) ...@@ -180,8 +180,7 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused dwc3_of_simple_runtime_suspend(struct device *dev)
static int dwc3_of_simple_runtime_suspend(struct device *dev)
{ {
struct dwc3_of_simple *simple = dev_get_drvdata(dev); struct dwc3_of_simple *simple = dev_get_drvdata(dev);
int i; int i;
...@@ -192,7 +191,7 @@ static int dwc3_of_simple_runtime_suspend(struct device *dev) ...@@ -192,7 +191,7 @@ static int dwc3_of_simple_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int dwc3_of_simple_runtime_resume(struct device *dev) static int __maybe_unused dwc3_of_simple_runtime_resume(struct device *dev)
{ {
struct dwc3_of_simple *simple = dev_get_drvdata(dev); struct dwc3_of_simple *simple = dev_get_drvdata(dev);
int ret; int ret;
...@@ -210,7 +209,7 @@ static int dwc3_of_simple_runtime_resume(struct device *dev) ...@@ -210,7 +209,7 @@ static int dwc3_of_simple_runtime_resume(struct device *dev)
return 0; return 0;
} }
static int dwc3_of_simple_suspend(struct device *dev) static int __maybe_unused dwc3_of_simple_suspend(struct device *dev)
{ {
struct dwc3_of_simple *simple = dev_get_drvdata(dev); struct dwc3_of_simple *simple = dev_get_drvdata(dev);
...@@ -220,7 +219,7 @@ static int dwc3_of_simple_suspend(struct device *dev) ...@@ -220,7 +219,7 @@ static int dwc3_of_simple_suspend(struct device *dev)
return 0; return 0;
} }
static int dwc3_of_simple_resume(struct device *dev) static int __maybe_unused dwc3_of_simple_resume(struct device *dev)
{ {
struct dwc3_of_simple *simple = dev_get_drvdata(dev); struct dwc3_of_simple *simple = dev_get_drvdata(dev);
...@@ -229,7 +228,6 @@ static int dwc3_of_simple_resume(struct device *dev) ...@@ -229,7 +228,6 @@ static int dwc3_of_simple_resume(struct device *dev)
return 0; return 0;
} }
#endif
static const struct dev_pm_ops dwc3_of_simple_dev_pm_ops = { static const struct dev_pm_ops dwc3_of_simple_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_of_simple_suspend, dwc3_of_simple_resume) SET_SYSTEM_SLEEP_PM_OPS(dwc3_of_simple_suspend, dwc3_of_simple_resume)
......
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