bcm27xx: add support for linux v5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.15 / 950-0725-media-i2c-Remove-.s_power-from-ov7251.patch
1 From 27a8c7902543676a670424b28fb9b43c6c4ce59b Mon Sep 17 00:00:00 2001
2 From: Daniel Scally <djrscally@gmail.com>
3 Date: Tue, 15 Feb 2022 23:07:36 +0000
4 Subject: [PATCH] media: i2c: Remove .s_power() from ov7251
5
6 The .s_power() callback is deprecated, and now that we have pm_runtime
7 functionality in the driver there's no further use for it. Delete the
8 function.
9
10 Signed-off-by: Daniel Scally <djrscally@gmail.com>
11 Reported-by: kernel test robot <lkp@intel.com>
12 ---
13 drivers/media/i2c/ov7251.c | 44 +-------------------------------------
14 1 file changed, 1 insertion(+), 43 deletions(-)
15
16 --- a/drivers/media/i2c/ov7251.c
17 +++ b/drivers/media/i2c/ov7251.c
18 @@ -903,43 +903,6 @@ static int __maybe_unused ov7251_sensor_
19 return ov7251_set_power_on(ov7251);
20 }
21
22 -static int ov7251_s_power(struct v4l2_subdev *sd, int on)
23 -{
24 - struct ov7251 *ov7251 = to_ov7251(sd);
25 - int ret = 0;
26 -
27 - mutex_lock(&ov7251->lock);
28 -
29 - /* If the power state is not modified - no work to do. */
30 - if (ov7251->power_on == !!on)
31 - goto exit;
32 -
33 - if (on) {
34 - ret = ov7251_set_power_on(ov7251);
35 - if (ret < 0)
36 - goto exit;
37 -
38 - ret = ov7251_set_register_array(ov7251,
39 - ov7251_global_init_setting,
40 - ARRAY_SIZE(ov7251_global_init_setting));
41 - if (ret < 0) {
42 - dev_err(ov7251->dev, "could not set init registers\n");
43 - ov7251_set_power_off(ov7251);
44 - goto exit;
45 - }
46 -
47 - ov7251->power_on = true;
48 - } else {
49 - ov7251_set_power_off(ov7251);
50 - ov7251->power_on = false;
51 - }
52 -
53 -exit:
54 - mutex_unlock(&ov7251->lock);
55 -
56 - return ret;
57 -}
58 -
59 static int ov7251_set_hflip(struct ov7251 *ov7251, s32 value)
60 {
61 u8 val = ov7251->timing_format2;
62 @@ -1384,10 +1347,6 @@ exit:
63 return ret;
64 }
65
66 -static const struct v4l2_subdev_core_ops ov7251_core_ops = {
67 - .s_power = ov7251_s_power,
68 -};
69 -
70 static const struct v4l2_subdev_video_ops ov7251_video_ops = {
71 .s_stream = ov7251_s_stream,
72 .g_frame_interval = ov7251_get_frame_interval,
73 @@ -1405,7 +1364,6 @@ static const struct v4l2_subdev_pad_ops
74 };
75
76 static const struct v4l2_subdev_ops ov7251_subdev_ops = {
77 - .core = &ov7251_core_ops,
78 .video = &ov7251_video_ops,
79 .pad = &ov7251_subdev_pad_ops,
80 };
81 @@ -1701,7 +1659,7 @@ err_pm_runtime:
82 pm_runtime_disable(ov7251->dev);
83 pm_runtime_put_noidle(ov7251->dev);
84 power_down:
85 - ov7251_s_power(&ov7251->sd, false);
86 + ov7251_set_power_off(ov7251);
87 free_entity:
88 media_entity_cleanup(&ov7251->sd.entity);
89 free_ctrl: