From e4b3011957be728d4567aa0e67becf9d81ad1ff3 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 28 Nov 2005 08:40:38 -0800 Subject: [PATCH] --- yaml --- r: 14826 b: refs/heads/master c: 8926bfa7462d4c3f8b05cca929e0c4bcde93ae38 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/ehci-pci.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 07fbf17f4c74..1188e4c1ba10 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8de98402652c01839ae321be6cb3054cf5735d83 +refs/heads/master: 8926bfa7462d4c3f8b05cca929e0c4bcde93ae38 diff --git a/trunk/drivers/usb/host/ehci-pci.c b/trunk/drivers/usb/host/ehci-pci.c index 14fff5714c1e..13f73a836e45 100644 --- a/trunk/drivers/usb/host/ehci-pci.c +++ b/trunk/drivers/usb/host/ehci-pci.c @@ -121,8 +121,8 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) return 0; } -/* called by khubd or root hub (re)init threads; leaves HC in halt state */ -static int ehci_pci_reset(struct usb_hcd *hcd) +/* called during probe() after chip reset completes */ +static int ehci_pci_setup(struct usb_hcd *hcd) { struct ehci_hcd *ehci = hcd_to_ehci(hcd); struct pci_dev *pdev = to_pci_dev(hcd->self.controller); @@ -141,6 +141,11 @@ static int ehci_pci_reset(struct usb_hcd *hcd) if (retval) return retval; + /* data structure init */ + retval = ehci_init(hcd); + if (retval) + return retval; + /* NOTE: only the parts below this line are PCI-specific */ switch (pdev->vendor) { @@ -154,7 +159,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd) /* AMD8111 EHCI doesn't work, according to AMD errata */ if (pdev->device == 0x7463) { ehci_info(ehci, "ignoring AMD8111 (errata)\n"); - return -EIO; + retval = -EIO; + goto done; } break; case PCI_VENDOR_ID_NVIDIA: @@ -207,9 +213,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd) /* REVISIT: per-port wake capability (PCI 0x62) currently unused */ retval = ehci_pci_reinit(ehci, pdev); - - /* finish init */ - return ehci_init(hcd); +done: + return retval; } /*-------------------------------------------------------------------------*/ @@ -344,7 +349,7 @@ static const struct hc_driver ehci_pci_hc_driver = { /* * basic lifecycle operations */ - .reset = ehci_pci_reset, + .reset = ehci_pci_setup, .start = ehci_run, #ifdef CONFIG_PM .suspend = ehci_pci_suspend,