langwell_otg: enable runtime pm at probe time
authorKristen Carlson Accardi <kristen@linux.intel.com>
Thu, 25 Aug 2011 11:20:33 +0000 (12:20 +0100)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 21:15:34 +0000 (13:15 -0800)
decrement the usage count at probe time and enable runtime pm.
At remove time, prevent runtime pm by incrementing usage count
and forbidding runtime pm.

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
drivers/usb/otg/langwell_otg.c

index f08f784..5937dbc 100644 (file)
@@ -2110,6 +2110,9 @@ static int langwell_otg_probe(struct pci_dev *pdev,
        if (lnw->iotg.otg.state == OTG_STATE_A_IDLE)
                langwell_update_transceiver();
 
+       pm_runtime_put_noidle(&pdev->dev);
+       pm_runtime_allow(&pdev->dev);
+
        return 0;
 
 err:
@@ -2123,6 +2126,9 @@ static void langwell_otg_remove(struct pci_dev *pdev)
 {
        struct langwell_otg *lnw = the_transceiver;
 
+       pm_runtime_get_noresume(&pdev->dev);
+       pm_runtime_forbid(&pdev->dev);
+
        if (lnw->qwork) {
                flush_workqueue(lnw->qwork);
                destroy_workqueue(lnw->qwork);