diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2020-09-18 11:23:39 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-12-03 12:27:32 +0100 |
commit | fd5cfde331f86e7712a037e68e9e66b29eaea9fa (patch) | |
tree | 5f976475243cd327d219ef2fb895f8096edeae76 /drivers/media/i2c | |
parent | 1b398012cee8d6c9fff15d74e462a5ace6f9ef7c (diff) |
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: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/ccs/ccs-core.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 5e01f22608d7..c3023570a620 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -1625,8 +1625,6 @@ static int ccs_pm_get_init(struct ccs_sensor *sensor) rval = pm_runtime_get_sync(&client->dev); if (rval < 0) { - if (rval != -EBUSY && rval != -EAGAIN) - pm_runtime_set_active(&client->dev); pm_runtime_put_noidle(&client->dev); return rval; @@ -2842,9 +2840,8 @@ static int __maybe_unused ccs_suspend(struct device *dev) rval = pm_runtime_get_sync(dev); if (rval < 0) { - if (rval != -EBUSY && rval != -EAGAIN) - pm_runtime_set_active(&client->dev); - pm_runtime_put(dev); + pm_runtime_put_noidle(dev); + return -EAGAIN; } |