mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-08 23:05:31 +02:00
media: camss: vfe: Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
606578801a
commit
779096916d
|
@ -1265,12 +1265,12 @@ static int vfe_get(struct vfe_device *vfe)
|
||||||
|
|
||||||
ret = vfe_set_clock_rates(vfe);
|
ret = vfe_set_clock_rates(vfe);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error_clocks;
|
goto error_pm_runtime_get;
|
||||||
|
|
||||||
ret = camss_enable_clocks(vfe->nclocks, vfe->clock,
|
ret = camss_enable_clocks(vfe->nclocks, vfe->clock,
|
||||||
vfe->camss->dev);
|
vfe->camss->dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error_clocks;
|
goto error_pm_runtime_get;
|
||||||
|
|
||||||
ret = vfe_reset(vfe);
|
ret = vfe_reset(vfe);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -1282,7 +1282,7 @@ static int vfe_get(struct vfe_device *vfe)
|
||||||
} else {
|
} else {
|
||||||
ret = vfe_check_clock_rates(vfe);
|
ret = vfe_check_clock_rates(vfe);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error_clocks;
|
goto error_pm_runtime_get;
|
||||||
}
|
}
|
||||||
vfe->power_count++;
|
vfe->power_count++;
|
||||||
|
|
||||||
|
@ -1293,10 +1293,8 @@ static int vfe_get(struct vfe_device *vfe)
|
||||||
error_reset:
|
error_reset:
|
||||||
camss_disable_clocks(vfe->nclocks, vfe->clock);
|
camss_disable_clocks(vfe->nclocks, vfe->clock);
|
||||||
|
|
||||||
error_clocks:
|
|
||||||
pm_runtime_put_sync(vfe->camss->dev);
|
|
||||||
|
|
||||||
error_pm_runtime_get:
|
error_pm_runtime_get:
|
||||||
|
pm_runtime_put_sync(vfe->camss->dev);
|
||||||
camss_pm_domain_off(vfe->camss, vfe->id);
|
camss_pm_domain_off(vfe->camss, vfe->id);
|
||||||
|
|
||||||
error_pm_domain:
|
error_pm_domain:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user