Commit da2e2d21 authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Greg Kroah-Hartman

staging: ccree: simplify pm manager using local var

Make the code more readable by using a local variable.
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 02e6f40c
...@@ -90,20 +90,24 @@ int cc_pm_resume(struct device *dev) ...@@ -90,20 +90,24 @@ int cc_pm_resume(struct device *dev)
int cc_pm_get(struct device *dev) int cc_pm_get(struct device *dev)
{ {
int rc = 0; int rc = 0;
struct ssi_drvdata *drvdata =
(struct ssi_drvdata *)dev_get_drvdata(dev);
if (cc_req_queue_suspended((struct ssi_drvdata *)dev_get_drvdata(dev))) { if (cc_req_queue_suspended(drvdata))
rc = pm_runtime_get_sync(dev); rc = pm_runtime_get_sync(dev);
} else { else
pm_runtime_get_noresume(dev); pm_runtime_get_noresume(dev);
}
return rc; return rc;
} }
int cc_pm_put_suspend(struct device *dev) int cc_pm_put_suspend(struct device *dev)
{ {
int rc = 0; int rc = 0;
struct ssi_drvdata *drvdata =
(struct ssi_drvdata *)dev_get_drvdata(dev);
if (!cc_req_queue_suspended((struct ssi_drvdata *)dev_get_drvdata(dev))) { if (!cc_req_queue_suspended(drvdata)) {
pm_runtime_mark_last_busy(dev); pm_runtime_mark_last_busy(dev);
rc = pm_runtime_put_autosuspend(dev); rc = pm_runtime_put_autosuspend(dev);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment