• Arnd Bergmann's avatar
    usb: dwc3: of-simple: avoid unused function warnings · 66174b69
    Arnd Bergmann authored
    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>
    66174b69
dwc3-of-simple.c 6.02 KB