Skip to content

Commit

Permalink
media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_…
Browse files Browse the repository at this point in the history
…probe

[ Upstream commit 395829c ]

The pm_runtime_enable will decrease power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().

Fixes: 0a0e265 ("media: atmel: atmel-isc: split driver into driver base and isc")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuuoniy authored and gregkh committed Jun 9, 2022
1 parent 0575524 commit ac2a4f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/platform/atmel/atmel-sama5d2-isc.c
Expand Up @@ -538,7 +538,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
ret = clk_prepare_enable(isc->ispck);
if (ret) {
dev_err(dev, "failed to enable ispck: %d\n", ret);
goto cleanup_subdev;
goto disable_pm;
}

/* ispck should be greater or equal to hclock */
Expand All @@ -556,6 +556,9 @@ static int atmel_isc_probe(struct platform_device *pdev)
unprepare_clk:
clk_disable_unprepare(isc->ispck);

disable_pm:
pm_runtime_disable(dev);

cleanup_subdev:
isc_subdev_cleanup(isc);

Expand Down

0 comments on commit ac2a4f0

Please sign in to comment.