USB: fix build error in cdc-acm for CONFIG_PM=n
authorOliver Neukum <oliver@neukum.org>
Tue, 1 Jul 2008 17:10:08 +0000 (19:10 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Jul 2008 22:16:47 +0000 (15:16 -0700)
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>
drivers/usb/class/cdc-acm.c
drivers/usb/class/cdc-wdm.c

index 93b28ee8e8bda362ffc863727a1117554f1c033d..95ae6377d7e545d9aa27142f10d80e051284f025 100644 (file)
@@ -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);
@@ -1320,6 +1321,8 @@ err_out:
        mutex_unlock(&acm->mutex);
        return rv;
 }
+
+#endif /* CONFIG_PM */
 /*
  * USB driver structure.
  */
@@ -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
 };
 
 /*
index 1103ce7016b13e6cc28114b0ec5088ff2336584f..7e8e1235e4e52d93cf3aa0ab930a7cce618bc7ea 100644 (file)
@@ -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;