From: Andrew Morton Cc: Oliver Neukum Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton --- drivers/usb/class/cdc-wdm.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff -puN drivers/usb/class/cdc-wdm.c~drivers-usb-class-cdc-wdmc-fix-build-with-config_pm=n drivers/usb/class/cdc-wdm.c --- a/drivers/usb/class/cdc-wdm.c~drivers-usb-class-cdc-wdmc-fix-build-with-config_pm=n +++ a/drivers/usb/class/cdc-wdm.c @@ -742,6 +742,19 @@ static void wdm_disconnect(struct usb_in mutex_unlock(&wdm_mutex); } +static int recover_from_urb_loss(struct wdm_device *desc) +{ + int rv = 0; + + if (desc->count) { + rv = usb_submit_urb(desc->validity, GFP_NOIO); + if (rv < 0) + err("Error resume submitting int urb - %d", rv); + } + return rv; +} + +#ifdef CONFIG_PM static int wdm_suspend(struct usb_interface *intf, pm_message_t message) { struct wdm_device *desc = usb_get_intfdata(intf); @@ -761,17 +774,6 @@ static int wdm_suspend(struct usb_interf return rv; } -static int recover_from_urb_loss(struct wdm_device *desc) -{ - int rv = 0; - - if (desc->count) { - rv = usb_submit_urb(desc->validity, GFP_NOIO); - if (rv < 0) - err("Error resume submitting int urb - %d", rv); - } - return rv; -} static int wdm_resume(struct usb_interface *intf) { struct wdm_device *desc = usb_get_intfdata(intf); @@ -783,6 +785,10 @@ static int wdm_resume(struct usb_interfa mutex_unlock(&desc->plock); return rv; } +#else +#define wdm_suspend NULL +#define wdm_resume NULL +#endif static int wdm_pre_reset(struct usb_interface *intf) { _