diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-04-23 17:19:13 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-05-10 11:36:33 +0200 |
commit | 62c90446868b439929cb04395f04a709a64ae04b (patch) | |
tree | 0eda07dada2b638f1286ca3b0328476a34220180 /drivers/ras | |
parent | da3a1858c3a37c09446e1470c48352897d59d11b (diff) | |
download | linux-stable-62c90446868b439929cb04395f04a709a64ae04b.tar.gz linux-stable-62c90446868b439929cb04395f04a709a64ae04b.tar.bz2 linux-stable-62c90446868b439929cb04395f04a709a64ae04b.zip |
media: i2c: imx334: fix the pm runtime get logic
The PM runtime get logic is currently broken, as it checks if
ret is zero instead of checking if it is an error code,
as reported by Dan Carpenter.
While here, use the pm_runtime_resume_and_get() as added by:
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. As a bonus, such function
always return zero on success.
It should also be noticed that a fail of pm_runtime_get_sync() would
potentially result in a spurious runtime_suspend(), instead of
using pm_runtime_put_noidle().
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/ras')
0 files changed, 0 insertions, 0 deletions