Skip to content

Commit

Permalink
USB: EHCI: initialize data before resetting hardware
Browse files Browse the repository at this point in the history
Currently, EHCI initialization turns off the controller (in case it
was left running by the firmware) before setting up the ehci_hcd data
structure.  This patch (as1565) reverses that order.

Although it doesn't matter now, it will matter later on when future
additions to ehci_halt() will want to acquire a spinlock that gets
initialized by ehci_init().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jul 16, 2012
1 parent 1f9be64 commit 631fe9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,12 +823,12 @@ static int ehci_setup(struct usb_hcd *hcd)

ehci->sbrn = HCD_USB2;

retval = ehci_halt(ehci);
/* data structure init */
retval = ehci_init(hcd);
if (retval)
return retval;

/* data structure init */
retval = ehci_init(hcd);
retval = ehci_halt(ehci);
if (retval)
return retval;

Expand Down

0 comments on commit 631fe9d

Please sign in to comment.