summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorRikard Falkeborn <rikard.falkeborn@gmail.com>2020-11-19 23:22:48 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-02-06 09:35:03 +0100
commitded8f0355a8821262a27a398d3f5587c29665dae (patch)
tree355b4f72fde5621518539871af1bbf15938c086d /drivers/media/i2c
parent85cb767cbfcd89d9949fca91bda8e7330f33e12a (diff)
downloadlinux-ded8f0355a8821262a27a398d3f5587c29665dae.tar.gz
linux-ded8f0355a8821262a27a398d3f5587c29665dae.tar.bz2
linux-ded8f0355a8821262a27a398d3f5587c29665dae.zip
media: i2c: rdacm20: Constify static structs
The only usage of rdacm20_video_ops is to assign it to the video field in the v4l2_subdev_ops struct which is a pointer to const, and the only usage of rdacm20_subdev_ops is to pass its address to v4l2_i2c_subdev_init() which accepts a pointer to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/rdacm20.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
index 16bcb764b0e0..90eb73f0e6e9 100644
--- a/drivers/media/i2c/rdacm20.c
+++ b/drivers/media/i2c/rdacm20.c
@@ -435,7 +435,7 @@ static int rdacm20_get_fmt(struct v4l2_subdev *sd,
return 0;
}
-static struct v4l2_subdev_video_ops rdacm20_video_ops = {
+static const struct v4l2_subdev_video_ops rdacm20_video_ops = {
.s_stream = rdacm20_s_stream,
};
@@ -445,7 +445,7 @@ static const struct v4l2_subdev_pad_ops rdacm20_subdev_pad_ops = {
.set_fmt = rdacm20_get_fmt,
};
-static struct v4l2_subdev_ops rdacm20_subdev_ops = {
+static const struct v4l2_subdev_ops rdacm20_subdev_ops = {
.video = &rdacm20_video_ops,
.pad = &rdacm20_subdev_pad_ops,
};