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