Skip to content

Commit

Permalink
USB: fix build error in cdc-acm for CONFIG_PM=n
Browse files Browse the repository at this point in the history
Here's the fix. cdc-wdm has the same problem. The fix is the same.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 95f371f commit 3575858
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ static void acm_disconnect(struct usb_interface *intf)
tty_hangup(acm->tty);
}

#ifdef CONFIG_PM
static int acm_suspend(struct usb_interface *intf, pm_message_t message)
{
struct acm *acm = usb_get_intfdata(intf);
Expand Down Expand Up @@ -1320,6 +1321,8 @@ static int acm_resume(struct usb_interface *intf)
mutex_unlock(&acm->mutex);
return rv;
}

#endif /* CONFIG_PM */
/*
* USB driver structure.
*/
Expand Down Expand Up @@ -1375,10 +1378,14 @@ static struct usb_driver acm_driver = {
.name = "cdc_acm",
.probe = acm_probe,
.disconnect = acm_disconnect,
#ifdef CONFIG_PM
.suspend = acm_suspend,
.resume = acm_resume,
#endif
.id_table = acm_ids,
#ifdef CONFIG_PM
.supports_autosuspend = 1,
#endif
};

/*
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

mutex_lock(&desc->plock);
#ifdef CONFIG_PM
if (interface_to_usbdev(desc->intf)->auto_pm && test_bit(WDM_IN_USE, &desc->flags)) {
rv = -EBUSY;
} else {
#endif
cancel_work_sync(&desc->rxwork);
kill_urbs(desc);
#ifdef CONFIG_PM
}
#endif
mutex_unlock(&desc->plock);

return rv;
Expand Down

0 comments on commit 3575858

Please sign in to comment.