media: imx: imx-mipi-csis: Don't use .s_power()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 11 Mar 2022 13:29:03 +0000 (13:29 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:56:16 +0000 (08:56 +0100)
The subdev .s_power() operation is deprecated. Drop it, requiring sensor
drivers to correctly use runtime PM instead of relying on .s_power().

As this driver has just been moved out of staging, and necessary drivers
to implement a full camera pipeline are still in staging, no platform
depends yet on this API being called. There is thus no risk of
regression.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/nxp/imx-mipi-csis.c

index 98c52c1b1c47d698bf8a8b8634a6f9030619ce4b..9054c30f343ad4e93a4efc9e95d99c9130917de9 100644 (file)
@@ -932,7 +932,7 @@ static struct mipi_csis_device *sd_to_mipi_csis_device(struct v4l2_subdev *sdev)
 static int mipi_csis_s_stream(struct v4l2_subdev *sd, int enable)
 {
        struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
-       int ret;
+       int ret = 0;
 
        if (enable) {
                ret = mipi_csis_calculate_params(csis);
@@ -944,10 +944,6 @@ static int mipi_csis_s_stream(struct v4l2_subdev *sd, int enable)
                ret = pm_runtime_resume_and_get(csis->dev);
                if (ret < 0)
                        return ret;
-
-               ret = v4l2_subdev_call(csis->src_sd, core, s_power, 1);
-               if (ret < 0 && ret != -ENOIOCTLCMD)
-                       goto done;
        }
 
        mutex_lock(&csis->lock);
@@ -968,9 +964,7 @@ static int mipi_csis_s_stream(struct v4l2_subdev *sd, int enable)
                csis->state |= ST_STREAMING;
        } else {
                v4l2_subdev_call(csis->src_sd, video, s_stream, 0);
-               ret = v4l2_subdev_call(csis->src_sd, core, s_power, 0);
-               if (ret == -ENOIOCTLCMD)
-                       ret = 0;
+
                mipi_csis_stop_stream(csis);
                csis->state &= ~ST_STREAMING;
                if (csis->debug.enable)
@@ -980,7 +974,6 @@ static int mipi_csis_s_stream(struct v4l2_subdev *sd, int enable)
 unlock:
        mutex_unlock(&csis->lock);
 
-done:
        if (!enable || ret < 0)
                pm_runtime_put(csis->dev);