diff options
author | David Brownell <david-b@pacbell.net> | 2005-11-28 11:40:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-11-30 00:39:23 -0500 |
commit | 8926bfa7462d4c3f8b05cca929e0c4bcde93ae38 (patch) | |
tree | 52f6841e035827751efee6b4616f84606db70663 /drivers/usb | |
parent | 8de98402652c01839ae321be6cb3054cf5735d83 (diff) |
[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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-pci.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 14fff5714c1e..13f73a836e45 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -121,8 +121,8 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) | |||
121 | return 0; | 121 | return 0; |
122 | } | 122 | } |
123 | 123 | ||
124 | /* called by khubd or root hub (re)init threads; leaves HC in halt state */ | 124 | /* called during probe() after chip reset completes */ |
125 | static int ehci_pci_reset(struct usb_hcd *hcd) | 125 | static int ehci_pci_setup(struct usb_hcd *hcd) |
126 | { | 126 | { |
127 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 127 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
128 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | 128 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); |
@@ -141,6 +141,11 @@ static int ehci_pci_reset(struct usb_hcd *hcd) | |||
141 | if (retval) | 141 | if (retval) |
142 | return retval; | 142 | return retval; |
143 | 143 | ||
144 | /* data structure init */ | ||
145 | retval = ehci_init(hcd); | ||
146 | if (retval) | ||
147 | return retval; | ||
148 | |||
144 | /* NOTE: only the parts below this line are PCI-specific */ | 149 | /* NOTE: only the parts below this line are PCI-specific */ |
145 | 150 | ||
146 | switch (pdev->vendor) { | 151 | switch (pdev->vendor) { |
@@ -154,7 +159,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd) | |||
154 | /* AMD8111 EHCI doesn't work, according to AMD errata */ | 159 | /* AMD8111 EHCI doesn't work, according to AMD errata */ |
155 | if (pdev->device == 0x7463) { | 160 | if (pdev->device == 0x7463) { |
156 | ehci_info(ehci, "ignoring AMD8111 (errata)\n"); | 161 | ehci_info(ehci, "ignoring AMD8111 (errata)\n"); |
157 | return -EIO; | 162 | retval = -EIO; |
163 | goto done; | ||
158 | } | 164 | } |
159 | break; | 165 | break; |
160 | case PCI_VENDOR_ID_NVIDIA: | 166 | case PCI_VENDOR_ID_NVIDIA: |
@@ -207,9 +213,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd) | |||
207 | /* REVISIT: per-port wake capability (PCI 0x62) currently unused */ | 213 | /* REVISIT: per-port wake capability (PCI 0x62) currently unused */ |
208 | 214 | ||
209 | retval = ehci_pci_reinit(ehci, pdev); | 215 | retval = ehci_pci_reinit(ehci, pdev); |
210 | 216 | done: | |
211 | /* finish init */ | 217 | return retval; |
212 | return ehci_init(hcd); | ||
213 | } | 218 | } |
214 | 219 | ||
215 | /*-------------------------------------------------------------------------*/ | 220 | /*-------------------------------------------------------------------------*/ |
@@ -344,7 +349,7 @@ static const struct hc_driver ehci_pci_hc_driver = { | |||
344 | /* | 349 | /* |
345 | * basic lifecycle operations | 350 | * basic lifecycle operations |
346 | */ | 351 | */ |
347 | .reset = ehci_pci_reset, | 352 | .reset = ehci_pci_setup, |
348 | .start = ehci_run, | 353 | .start = ehci_run, |
349 | #ifdef CONFIG_PM | 354 | #ifdef CONFIG_PM |
350 | .suspend = ehci_pci_suspend, | 355 | .suspend = ehci_pci_suspend, |