]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/host/ohci-omap3.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit
[~andy/linux] / drivers / usb / host / ohci-omap3.c
index 516ebc4d6cc29a820c13d3ee4578d3c6e49c2ad8..1b8133b6e451a7a30965eae265a4106c3050521f 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <linux/platform_device.h>
 #include <plat/usb.h>
+#include <linux/pm_runtime.h>
 
 /*-------------------------------------------------------------------------*/
 
@@ -134,7 +135,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
        int                     irq;
 
        if (usb_disabled())
-               goto err_end;
+               return -ENODEV;
 
        if (!dev->parent) {
                dev_err(dev, "Missing parent device\n");
@@ -172,11 +173,8 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
        hcd->rsrc_len = resource_size(res);
        hcd->regs =  regs;
 
-       ret = omap_usbhs_enable(dev);
-       if (ret) {
-               dev_dbg(dev, "failed to start ohci\n");
-               goto err_end;
-       }
+       pm_runtime_enable(dev);
+       pm_runtime_get_sync(dev);
 
        ohci_hcd_init(hcd_to_ohci(hcd));
 
@@ -189,9 +187,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
        return 0;
 
 err_add_hcd:
-       omap_usbhs_disable(dev);
-
-err_end:
+       pm_runtime_put_sync(dev);
        usb_put_hcd(hcd);
 
 err_io:
@@ -220,9 +216,9 @@ static int __devexit ohci_hcd_omap3_remove(struct platform_device *pdev)
 
        iounmap(hcd->regs);
        usb_remove_hcd(hcd);
-       omap_usbhs_disable(dev);
+       pm_runtime_put_sync(dev);
+       pm_runtime_disable(dev);
        usb_put_hcd(hcd);
-
        return 0;
 }