usb: dwc3: of-simple: avoid unused function warnings
authorArnd Bergmann <arnd@arndb.de>
Mon, 13 Aug 2018 21:56:55 +0000 (23:56 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 29 Aug 2018 06:59:37 +0000 (09:59 +0300)
commit66174b6998a645c39867c3a301b4ee4611d6ca5b
tree23520e926dca45cbbf03327fddb36df1badd698a
parent5b394b2ddf0347bef56e50c69a58773c94343ff3
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: 76251db86561 ("usb: dwc3: of-simple: reset host controller at suspend/resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/dwc3-of-simple.c