Commit fd5cfde3 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: ccs: Clean up runtime PM usage

If pm_runtime_get_sync() fails, there's no need to set the device active
again. Also, in the same case to return the usage_count to zero,
pm_runtime_put_noidle() is enough.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 1b398012
...@@ -1625,8 +1625,6 @@ static int ccs_pm_get_init(struct ccs_sensor *sensor) ...@@ -1625,8 +1625,6 @@ static int ccs_pm_get_init(struct ccs_sensor *sensor)
rval = pm_runtime_get_sync(&client->dev); rval = pm_runtime_get_sync(&client->dev);
if (rval < 0) { if (rval < 0) {
if (rval != -EBUSY && rval != -EAGAIN)
pm_runtime_set_active(&client->dev);
pm_runtime_put_noidle(&client->dev); pm_runtime_put_noidle(&client->dev);
return rval; return rval;
...@@ -2842,9 +2840,8 @@ static int __maybe_unused ccs_suspend(struct device *dev) ...@@ -2842,9 +2840,8 @@ static int __maybe_unused ccs_suspend(struct device *dev)
rval = pm_runtime_get_sync(dev); rval = pm_runtime_get_sync(dev);
if (rval < 0) { if (rval < 0) {
if (rval != -EBUSY && rval != -EAGAIN) pm_runtime_put_noidle(dev);
pm_runtime_set_active(&client->dev);
pm_runtime_put(dev);
return -EAGAIN; return -EAGAIN;
} }
......
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