[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>

authored by David Brownell and committed by Greg Kroah-Hartman 8926bfa7 8de98402

+12 -7
+12 -7
drivers/usb/host/ehci-pci.c
··· 121 121 return 0; 122 122 } 123 123 124 - /* called by khubd or root hub (re)init threads; leaves HC in halt state */ 125 - static int ehci_pci_reset(struct usb_hcd *hcd) 124 + /* called during probe() after chip reset completes */ 125 + static int ehci_pci_setup(struct usb_hcd *hcd) 126 126 { 127 127 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 128 128 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); ··· 141 141 if (retval) 142 142 return retval; 143 143 144 + /* data structure init */ 145 + retval = ehci_init(hcd); 146 + if (retval) 147 + return retval; 148 + 144 149 /* NOTE: only the parts below this line are PCI-specific */ 145 150 146 151 switch (pdev->vendor) { ··· 159 154 /* AMD8111 EHCI doesn't work, according to AMD errata */ 160 155 if (pdev->device == 0x7463) { 161 156 ehci_info(ehci, "ignoring AMD8111 (errata)\n"); 162 - return -EIO; 157 + retval = -EIO; 158 + goto done; 163 159 } 164 160 break; 165 161 case PCI_VENDOR_ID_NVIDIA: ··· 213 207 /* REVISIT: per-port wake capability (PCI 0x62) currently unused */ 214 208 215 209 retval = ehci_pci_reinit(ehci, pdev); 216 - 217 - /* finish init */ 218 - return ehci_init(hcd); 210 + done: 211 + return retval; 219 212 } 220 213 221 214 /*-------------------------------------------------------------------------*/ ··· 349 344 /* 350 345 * basic lifecycle operations 351 346 */ 352 - .reset = ehci_pci_reset, 347 + .reset = ehci_pci_setup, 353 348 .start = ehci_run, 354 349 #ifdef CONFIG_PM 355 350 .suspend = ehci_pci_suspend,