Commit b6a736e7 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

media: imx-mipi-csis: Don't take lock in runtime PM handlers

The runtime PM handlers don't need manual locking as

- they are serialized by the runtime PM core
- they can't race with other functions taking the same lock, as they
  don't access any data protect by that lock

Drop the locking.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Adam Ford <aford173@gmail.com> #imx8mn-beacon
Acked-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent a42b43f7
......@@ -1348,40 +1348,34 @@ static int __maybe_unused mipi_csis_runtime_suspend(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
int ret = 0;
mutex_lock(&csis->lock);
int ret;
ret = mipi_csis_phy_disable(csis);
if (ret)
goto unlock;
return -EAGAIN;
mipi_csis_clk_disable(csis);
unlock:
mutex_unlock(&csis->lock);
return ret ? -EAGAIN : 0;
return 0;
}
static int __maybe_unused mipi_csis_runtime_resume(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
int ret = 0;
mutex_lock(&csis->lock);
int ret;
ret = mipi_csis_phy_enable(csis);
if (ret)
goto unlock;
mipi_csis_clk_enable(csis);
return -EAGAIN;
unlock:
mutex_unlock(&csis->lock);
ret = mipi_csis_clk_enable(csis);
if (ret) {
mipi_csis_phy_disable(csis);
return ret;
}
return ret ? -EAGAIN : 0;
return 0;
}
static const struct dev_pm_ops mipi_csis_pm_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment