media: atmel: properly get pm_runtime
There are several issues in the way the atmel driver handles
pm_runtime_get_sync():
- it doesn't check return codes;
- it doesn't properly decrement the usage_count on all places;
- it starts streaming even if pm_runtime_get_sync() fails.
- while it tries to get pm_runtime at the clock enable logic,
it doesn't check if the operation was suceeded.
Replace all occurrences of it to use the new kAPI:
pm_runtime_resume_and_get(), which ensures that, if the
return code is not negative, the usage_count was incremented.
With that, add additional checks when this is called, in order
to ensure that errors will be properly addressed.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Showing
Please register or sign in to comment