diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 9c5057c633271b05428923a89efc5545f4e4138d..fce4924dbbe88b6c49dbea3fe33221e224aece05 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -1134,6 +1134,10 @@ static int __init zero_bind(struct usb_gadget *gadget) dev->gadget = gadget; set_gadget_data(gadget, dev); + init_timer(&dev->resume); + dev->resume.function = zero_autoresume; + dev->resume.data = (unsigned long) dev; + /* preallocate control response and buffer */ dev->req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL); if (!dev->req) @@ -1165,9 +1169,6 @@ static int __init zero_bind(struct usb_gadget *gadget) usb_gadget_set_selfpowered(gadget); - init_timer(&dev->resume); - dev->resume.function = zero_autoresume; - dev->resume.data = (unsigned long) dev; if (autoresume) { source_sink_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP; loopback_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;