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>
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:
{
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);