diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-04-23 17:19:21 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-05-19 09:51:42 +0200 |
commit | deb9119f807abd01d4d78a2dc567b10e2501ec79 (patch) | |
tree | 3105d6c427ab03e2552d1bdf231339c8a125934c /drivers/staging/media/atomisp | |
parent | 75ecb9c83cf9d29eaa05bbdd0f84356ac22ed972 (diff) | |
download | linux-deb9119f807abd01d4d78a2dc567b10e2501ec79.tar.bz2 |
staging: media: atomisp: use pm_runtime_resume_and_get()
Commit dd8088d5a896 ("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>
Diffstat (limited to 'drivers/staging/media/atomisp')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_fops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index f1e6b2597853..26d05474a035 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -837,7 +837,7 @@ dev_init: } /* 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 @@ done: 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; } |