Commit 35758589 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

USB: fix build error in cdc-acm for CONFIG_PM=n

Here's the fix. cdc-wdm has the same problem. The fix is the same.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 95f371f2
...@@ -1255,6 +1255,7 @@ static void acm_disconnect(struct usb_interface *intf) ...@@ -1255,6 +1255,7 @@ static void acm_disconnect(struct usb_interface *intf)
tty_hangup(acm->tty); tty_hangup(acm->tty);
} }
#ifdef CONFIG_PM
static int acm_suspend(struct usb_interface *intf, pm_message_t message) static int acm_suspend(struct usb_interface *intf, pm_message_t message)
{ {
struct acm *acm = usb_get_intfdata(intf); struct acm *acm = usb_get_intfdata(intf);
...@@ -1320,6 +1321,8 @@ static int acm_resume(struct usb_interface *intf) ...@@ -1320,6 +1321,8 @@ static int acm_resume(struct usb_interface *intf)
mutex_unlock(&acm->mutex); mutex_unlock(&acm->mutex);
return rv; return rv;
} }
#endif /* CONFIG_PM */
/* /*
* USB driver structure. * USB driver structure.
*/ */
...@@ -1375,10 +1378,14 @@ static struct usb_driver acm_driver = { ...@@ -1375,10 +1378,14 @@ static struct usb_driver acm_driver = {
.name = "cdc_acm", .name = "cdc_acm",
.probe = acm_probe, .probe = acm_probe,
.disconnect = acm_disconnect, .disconnect = acm_disconnect,
#ifdef CONFIG_PM
.suspend = acm_suspend, .suspend = acm_suspend,
.resume = acm_resume, .resume = acm_resume,
#endif
.id_table = acm_ids, .id_table = acm_ids,
#ifdef CONFIG_PM
.supports_autosuspend = 1, .supports_autosuspend = 1,
#endif
}; };
/* /*
......
...@@ -750,12 +750,16 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -750,12 +750,16 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message)
dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor); dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor);
mutex_lock(&desc->plock); mutex_lock(&desc->plock);
#ifdef CONFIG_PM
if (interface_to_usbdev(desc->intf)->auto_pm && test_bit(WDM_IN_USE, &desc->flags)) { if (interface_to_usbdev(desc->intf)->auto_pm && test_bit(WDM_IN_USE, &desc->flags)) {
rv = -EBUSY; rv = -EBUSY;
} else { } else {
#endif
cancel_work_sync(&desc->rxwork); cancel_work_sync(&desc->rxwork);
kill_urbs(desc); kill_urbs(desc);
#ifdef CONFIG_PM
} }
#endif
mutex_unlock(&desc->plock); mutex_unlock(&desc->plock);
return rv; return rv;
......
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