Re: linux-next: Tree for June 30 (USB: cdc-acm)

Oliver Neukum
2008-07-01T17:09:51Z

Am Montag 30 Juni 2008 21:01:25 schrieb Greg KH:
> On Mon, Jun 30, 2008 at 11:43:32AM -0700, Randy Dunlap wrote:
> > cdc-acm fails to build when CONFIG_PM=n:
> >
> > linux-next-20080630/drivers/usb/class/cdc-acm.c: In function 'acm_suspend':
> > linux-next-20080630/drivers/usb/class/cdc-acm.c:1263: error: 'struct usb_device' has no member named 'auto_pm'
> > make[4]: *** [drivers/usb/class/cdc-acm.o] Error 1
>
> Yeah, known issue due to the pm and usb trees conflicting here. It will
> be fixed up at the merge time with Linus.

Here's the fix. cdc-wdm has the same problem. The fix is the same.

Regards
Oliver

Signed-off-by: Oliver Neukum <oneukum@suse.de>

---

--- linux-2.6.26-greg/drivers/usb/class/cdc-acm.alt.c 2008-07-01 11:22:06.000000000 +0200
+++ linux-2.6.26-greg/drivers/usb/class/cdc-acm.c 2008-07-01 11:24:24.000000000 +0200
@@ -1258,6 +1258,7 @@ static void acm_disconnect(struct usb_in
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);
@@ -1323,6 +1324,8 @@ err_out:
mutex_unlock(&acm->mutex);
return rv;
}
+
+#endif /* CONFIG_PM */
/*
* USB driver structure.
*/
@@ -1378,10 +1381,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
};

/*
--- linux-2.6.26-greg/drivers/usb/class/cdc-wdm.alt.c 2008-07-01 11:36:03.000000000 +0200
+++ linux-2.6.26-greg/drivers/usb/class/cdc-wdm.c 2008-07-01 11:36:35.000000000 +0200
@@ -750,12 +750,16 @@ static int wdm_suspend(struct usb_interf
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;