[PATCH 1/2] ARM: OMAP: USB: Fixup ehci_hcd_omap_probe error path

2012-06-21 Thread Russ Dill
A recent commit, [PATCH] Fix OMAP EHCI suspend/resume failure
(i693) '354ab856' causes ehci probe to fail on omap3xxx. This
exposed bugs in the ehci_hcd_omap_probe error path causing
an oops.

On the error path, call usb_remove_hcd if usb_add_hcd has been
called, and call usb_put_hcd if usb_alloc_hcd has been called.

Tested on BB-xM.

Signed-off-by: russ.d...@ti.com
---
 drivers/usb/host/ehci-omap.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 17cfb8a..6e15fc8 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -347,7 +347,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (ret) {
dev_err(dev, failed to add hcd with err %d\n, ret);
-   goto err_add_hcd;
+   goto err_pm_runtime;
}
 
/* root ports should always stay powered */
@@ -424,8 +424,12 @@ err_utmi_p1_fck:
clk_put(utmi_p1_fck);
 
 err_add_hcd:
+   usb_remove_hcd(hcd);
+
+err_pm_runtime:
disable_put_regulator(pdata);
pm_runtime_put_sync(dev);
+   usb_put_hcd(hcd);
 
 err_io:
iounmap(regs);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] ARM: OMAP: USB: Fixup ehci_hcd_omap_probe error path

2012-06-21 Thread Sergei Shtylyov

Hello.

On 21-06-2012 14:44, Russ Dill wrote:


A recent commit, [PATCH] Fix OMAP EHCI suspend/resume failure
(i693) '354ab856'


   Usually commit ID follows the word commit, and then the commit summary.


causes ehci probe to fail on omap3xxx. This
exposed bugs in the ehci_hcd_omap_probe error path causing
an oops.



On the error path, call usb_remove_hcd if usb_add_hcd has been
called, and call usb_put_hcd if usb_alloc_hcd has been called.



Tested on BB-xM.



Signed-off-by: russ.d...@ti.com


   It should be:

Signed-off-by: Russ Dill russ.d...@ti.com

WBR, Sergei
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] ARM: OMAP: USB: Fixup ehci_hcd_omap_probe error path

2012-06-21 Thread Alan Stern
On Thu, 21 Jun 2012, Russ Dill wrote:

 A recent commit, [PATCH] Fix OMAP EHCI suspend/resume failure
 (i693) '354ab856' causes ehci probe to fail on omap3xxx. This
 exposed bugs in the ehci_hcd_omap_probe error path causing
 an oops.
 
 On the error path, call usb_remove_hcd if usb_add_hcd has been
 called, and call usb_put_hcd if usb_alloc_hcd has been called.
 
 Tested on BB-xM.
 
 Signed-off-by: russ.d...@ti.com

Acked-by: Alan Stern st...@rowland.harvard.edu

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html