drm/vc4: vec: Use pm_runtime_resume_and_get() in vc4_vec_encoder_enable()

Commit f0601ef863 ("drm/vc4: vec: Protect device resources after
removal") add fail path for vc4_vec_encoder_enable(), and will put
usage_counter only when pm_runtime_get_sync() succeeds. However,
pm_runtime_get_sync() will increment usage_counter even it failed. Fix
it by replacing it with pm_runtime_resume_and_get() to keep usage
counter balanced.

Fixes: e4b81f8c74 ("drm/vc4: Add support for the VEC (Video Encoder) IP")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20221124015113.18540-1-shangxiaojing@huawei.com
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
This commit is contained in:
Shang XiaoJing 2022-11-24 09:51:13 +08:00 • committed by Maxime Ripard
commit 0ae41323a8
No known key found for this signature in database
GPG key ID: E3EF0D6F671851C5