From: Peter Chen Date: Wed, 5 Jan 2011 06:50:54 +0000 (+0800) Subject: usb: set ep_dev async suspend should be later than device_initialize X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=956227120f2e8eed8ca459879d7eafee78591cc1;p=linux-beck.git usb: set ep_dev async suspend should be later than device_initialize The dev->power.async_suspend can only be set at the condition of dev->power.status is DPM_ON. The dev->power.status will be initialized as DPM_ON at device_initialize. Signed-off-by: Peter Chen Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 9da250563027..df502a98d0df 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -192,12 +192,12 @@ int usb_create_ep_devs(struct device *parent, ep_dev->dev.parent = parent; ep_dev->dev.release = ep_device_release; dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); - device_enable_async_suspend(&ep_dev->dev); retval = device_register(&ep_dev->dev); if (retval) goto error_register; + device_enable_async_suspend(&ep_dev->dev); endpoint->ep_dev = ep_dev; return retval;