]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: i2c: Remove .s_power() from ov7251
authorDaniel Scally <djrscally@gmail.com>
Thu, 5 May 2022 23:03:57 +0000 (01:03 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 17 May 2022 07:51:59 +0000 (09:51 +0200)
The .s_power() callback is deprecated, and now that we have pm_runtime
functionality in the driver there's no further use for it. Delete the
function.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/ov7251.c

index 1713c6e22ccd21d57845705d4bcb8a16445eab25..a1326d03bcdd880a04de0d79370cf33b6cd7d50f 100644 (file)
@@ -910,7 +910,16 @@ static int ov7251_set_power_on(struct device *dev)
                               DIV_ROUND_UP(ov7251->xclk_freq, 1000));
        usleep_range(wait_us, wait_us + 1000);
 
-       return 0;
+       ret = ov7251_set_register_array(ov7251,
+                                       ov7251_global_init_setting,
+                                       ARRAY_SIZE(ov7251_global_init_setting));
+       if (ret < 0) {
+               dev_err(ov7251->dev, "error during global init\n");
+               ov7251_regulators_disable(ov7251);
+               return ret;
+       }
+
+       return ret;
 }
 
 static int ov7251_set_power_off(struct device *dev)
@@ -926,43 +935,6 @@ static int ov7251_set_power_off(struct device *dev)
        return 0;
 }
 
-static int ov7251_s_power(struct v4l2_subdev *sd, int on)
-{
-       struct ov7251 *ov7251 = to_ov7251(sd);
-       int ret = 0;
-
-       mutex_lock(&ov7251->lock);
-
-       /* If the power state is not modified - no work to do. */
-       if (ov7251->power_on == !!on)
-               goto exit;
-
-       if (on) {
-               ret = ov7251_set_power_on(ov7251->dev);
-               if (ret < 0)
-                       goto exit;
-
-               ret = ov7251_set_register_array(ov7251,
-                                       ov7251_global_init_setting,
-                                       ARRAY_SIZE(ov7251_global_init_setting));
-               if (ret < 0) {
-                       dev_err(ov7251->dev, "could not set init registers\n");
-                       ov7251_set_power_off(ov7251->dev);
-                       goto exit;
-               }
-
-               ov7251->power_on = true;
-       } else {
-               ov7251_set_power_off(ov7251->dev);
-               ov7251->power_on = false;
-       }
-
-exit:
-       mutex_unlock(&ov7251->lock);
-
-       return ret;
-}
-
 static int ov7251_set_hflip(struct ov7251 *ov7251, s32 value)
 {
        u8 val = ov7251->timing_format2;
@@ -1387,10 +1359,6 @@ exit:
        return ret;
 }
 
-static const struct v4l2_subdev_core_ops ov7251_core_ops = {
-       .s_power = ov7251_s_power,
-};
-
 static const struct v4l2_subdev_video_ops ov7251_video_ops = {
        .s_stream = ov7251_s_stream,
        .g_frame_interval = ov7251_get_frame_interval,
@@ -1408,7 +1376,6 @@ static const struct v4l2_subdev_pad_ops ov7251_subdev_pad_ops = {
 };
 
 static const struct v4l2_subdev_ops ov7251_subdev_ops = {
-       .core = &ov7251_core_ops,
        .video = &ov7251_video_ops,
        .pad = &ov7251_subdev_pad_ops,
 };