mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 15:50:10 -04:00
staging: media: atomisp: use pm_runtime_resume_and_get()
Commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
added pm_runtime_resume_and_get() in order to automatically handle
dev->power.usage_count decrement on errors.
Use the new API, in order to cleanup the error check logic.
Besides that, the de-init order in case of css error was wrong.
This change should also fix that.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
@@ -837,7 +837,7 @@ static int atomisp_open(struct file *file)
|
||||
}
|
||||
|
||||
/* runtime power management, turn on ISP */
|
||||
ret = pm_runtime_get_sync(vdev->v4l2_dev->dev);
|
||||
ret = pm_runtime_resume_and_get(vdev->v4l2_dev->dev);
|
||||
if (ret < 0) {
|
||||
dev_err(isp->dev, "Failed to power on device\n");
|
||||
goto error;
|
||||
@@ -881,9 +881,9 @@ static int atomisp_open(struct file *file)
|
||||
|
||||
css_error:
|
||||
atomisp_css_uninit(isp);
|
||||
pm_runtime_put(vdev->v4l2_dev->dev);
|
||||
error:
|
||||
hmm_pool_unregister(HMM_POOL_TYPE_DYNAMIC);
|
||||
pm_runtime_put(vdev->v4l2_dev->dev);
|
||||
rt_mutex_unlock(&isp->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user