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 <[email protected]> --- drivers/usb/otg/langwell_otg.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/usb/otg/langwell_otg.c b/drivers/usb/otg/langwell_otg.c index 33ea4b1..e368ee1 100644 --- a/drivers/usb/otg/langwell_otg.c +++ b/drivers/usb/otg/langwell_otg.c @@ -2128,6 +2128,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: @@ -2141,6 +2144,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); -- 1.7.3.1 _______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
