Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a828d818 authored by Julia Lawall's avatar Julia Lawall Committed by Mauro Carvalho Chehab
Browse files

media: v4l: mt9t001: constify video_subdev structures



The v4l2_subdev_ops structure is only passed as the third argument of
v4l2_i2c_subdev_init, which is const, so the v4l2_subdev_ops structure
can be const as well.  The other structures are only stored in the
v4l2_subdev_ops structure, all the fields of which are const, so these
structures can also be const.

Done with the help of Coccinelle.

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent f1425381
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -822,15 +822,15 @@ static int mt9t001_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
	return mt9t001_set_power(subdev, 0);
}

static struct v4l2_subdev_core_ops mt9t001_subdev_core_ops = {
static const struct v4l2_subdev_core_ops mt9t001_subdev_core_ops = {
	.s_power = mt9t001_set_power,
};

static struct v4l2_subdev_video_ops mt9t001_subdev_video_ops = {
static const struct v4l2_subdev_video_ops mt9t001_subdev_video_ops = {
	.s_stream = mt9t001_s_stream,
};

static struct v4l2_subdev_pad_ops mt9t001_subdev_pad_ops = {
static const struct v4l2_subdev_pad_ops mt9t001_subdev_pad_ops = {
	.enum_mbus_code = mt9t001_enum_mbus_code,
	.enum_frame_size = mt9t001_enum_frame_size,
	.get_fmt = mt9t001_get_format,
@@ -839,7 +839,7 @@ static struct v4l2_subdev_pad_ops mt9t001_subdev_pad_ops = {
	.set_selection = mt9t001_set_selection,
};

static struct v4l2_subdev_ops mt9t001_subdev_ops = {
static const struct v4l2_subdev_ops mt9t001_subdev_ops = {
	.core = &mt9t001_subdev_core_ops,
	.video = &mt9t001_subdev_video_ops,
	.pad = &mt9t001_subdev_pad_ops,