Commit 8926bfa7 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: ehci fixups

Rename the EHCI "reset" routine so it better matches what it does (setup);
and move the one-time data structure setup earlier, before doing anything
that implicitly relies on it having been completed already.

From: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8de98402
...@@ -121,8 +121,8 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) ...@@ -121,8 +121,8 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
return 0; return 0;
} }
/* called by khubd or root hub (re)init threads; leaves HC in halt state */ /* called during probe() after chip reset completes */
static int ehci_pci_reset(struct usb_hcd *hcd) static int ehci_pci_setup(struct usb_hcd *hcd)
{ {
struct ehci_hcd *ehci = hcd_to_ehci(hcd); struct ehci_hcd *ehci = hcd_to_ehci(hcd);
struct pci_dev *pdev = to_pci_dev(hcd->self.controller); struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
...@@ -141,6 +141,11 @@ static int ehci_pci_reset(struct usb_hcd *hcd) ...@@ -141,6 +141,11 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
if (retval) if (retval)
return retval; return retval;
/* data structure init */
retval = ehci_init(hcd);
if (retval)
return retval;
/* NOTE: only the parts below this line are PCI-specific */ /* NOTE: only the parts below this line are PCI-specific */
switch (pdev->vendor) { switch (pdev->vendor) {
...@@ -154,7 +159,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd) ...@@ -154,7 +159,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
/* AMD8111 EHCI doesn't work, according to AMD errata */ /* AMD8111 EHCI doesn't work, according to AMD errata */
if (pdev->device == 0x7463) { if (pdev->device == 0x7463) {
ehci_info(ehci, "ignoring AMD8111 (errata)\n"); ehci_info(ehci, "ignoring AMD8111 (errata)\n");
return -EIO; retval = -EIO;
goto done;
} }
break; break;
case PCI_VENDOR_ID_NVIDIA: case PCI_VENDOR_ID_NVIDIA:
...@@ -207,9 +213,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd) ...@@ -207,9 +213,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
/* REVISIT: per-port wake capability (PCI 0x62) currently unused */ /* REVISIT: per-port wake capability (PCI 0x62) currently unused */
retval = ehci_pci_reinit(ehci, pdev); retval = ehci_pci_reinit(ehci, pdev);
done:
/* finish init */ return retval;
return ehci_init(hcd);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -344,7 +349,7 @@ static const struct hc_driver ehci_pci_hc_driver = { ...@@ -344,7 +349,7 @@ static const struct hc_driver ehci_pci_hc_driver = {
/* /*
* basic lifecycle operations * basic lifecycle operations
*/ */
.reset = ehci_pci_reset, .reset = ehci_pci_setup,
.start = ehci_run, .start = ehci_run,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = ehci_pci_suspend, .suspend = ehci_pci_suspend,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment