[PATCH 13/27] mei: use pm_runtime_last_busy_and_autosuspend helper

From: Vinod Koul
Date: Wed Sep 24 2014 - 12:47:06 EST


Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code

Signed-off-by: Vinod Koul <vinod.koul@xxxxxxxxx>
---
drivers/misc/mei/client.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 324e1de..e522c01 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -519,8 +519,7 @@ int mei_cl_disconnect(struct mei_cl *cl)
mei_io_list_flush(&dev->ctrl_wr_list, cl);
free:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);

mei_io_cb_free(cb);
return rets;
@@ -625,8 +624,7 @@ int mei_cl_connect(struct mei_cl *cl, struct file *file)

out:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);

mei_io_cb_free(cb);
return rets;
@@ -779,8 +777,7 @@ int mei_cl_read_start(struct mei_cl *cl, size_t length)

out:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);

if (rets)
mei_io_cb_free(cb);
@@ -978,8 +975,7 @@ out:
rets = buf->size;
err:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);

return rets;
}
--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/