Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259238
b: refs/heads/master
c: 2542787
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Greg Kroah-Hartman committed Jul 1, 2011
1 parent a685f65 commit d22c5cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9c23a255a33cf423336b7cba39b2b6dcc83a6bc
refs/heads/master: 2542787430fc46b4e07e0da4c6ec80ed230032e5
34 changes: 7 additions & 27 deletions trunk/drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,31 +944,21 @@ static int dummy_udc_start(struct usb_gadget_driver *driver,
return retval;
}

/* khubd will enumerate this in a while */
spin_lock_irq (&dum->lock);
dum->pullup = 1;
if (dum->gadget.speed == USB_SPEED_SUPER) {
if (dum->gadget.speed == USB_SPEED_SUPER)
dum->gadget.is_otg =
(dummy_hcd_to_hcd(dum->ss_hcd)->self.otg_port != 0);
set_link_state(dum->ss_hcd);
} else {
else
dum->gadget.is_otg =
(dummy_hcd_to_hcd(dum->hs_hcd)->self.otg_port != 0);
set_link_state(dum->hs_hcd);
}

spin_unlock_irq (&dum->lock);

usb_hcd_poll_rh_status((dum->gadget.speed == USB_SPEED_SUPER ?
dummy_hcd_to_hcd(dum->ss_hcd) :
dummy_hcd_to_hcd(dum->hs_hcd)));
/* khubd will enumerate this in a while */
dummy_pullup(&dum->gadget, 1);
return 0;
}

static int dummy_udc_stop(struct usb_gadget_driver *driver)
{
struct dummy *dum = &the_controller;
unsigned long flags;

if (!dum)
return -ENODEV;
Expand All @@ -978,23 +968,13 @@ static int dummy_udc_stop(struct usb_gadget_driver *driver)
dev_dbg (udc_dev(dum), "unregister gadget driver '%s'\n",
driver->driver.name);

spin_lock_irqsave (&dum->lock, flags);
dum->pullup = 0;
set_link_state((dum->gadget.speed == USB_SPEED_SUPER ?
dum->ss_hcd : dum->hs_hcd));
spin_unlock_irqrestore (&dum->lock, flags);
dummy_pullup(&dum->gadget, 0);

driver->unbind (&dum->gadget);
dum->gadget.dev.driver = NULL;
dum->driver = NULL;
spin_lock_irqsave (&dum->lock, flags);
dum->pullup = 0;
set_link_state((dum->gadget.speed == USB_SPEED_SUPER ?
dum->ss_hcd : dum->hs_hcd));
spin_unlock_irqrestore (&dum->lock, flags);
usb_hcd_poll_rh_status((dum->gadget.speed == USB_SPEED_SUPER ?
dummy_hcd_to_hcd(dum->ss_hcd) :
dummy_hcd_to_hcd(dum->hs_hcd)));

dummy_pullup(&dum->gadget, 0);
return 0;
}

Expand Down

0 comments on commit d22c5cd

Please sign in to comment.