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

Commit 3805f201 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB: v4l2-subdev.h: fix enum_mbus_fmt prototype



enum_mbus_fmt received an index argument that was defined as an int instead
of an unsigned int. This is now fixed. This had the knock-on effect that the
index argument in the callback get_formats in soc_camera.h also had to be
changed to unsigned int.

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent cf69b808
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ static int ak881x_s_mbus_fmt(struct v4l2_subdev *sd,
	return ak881x_try_g_mbus_fmt(sd, mf);
}

static int ak881x_enum_mbus_fmt(struct v4l2_subdev *sd, int index,
static int ak881x_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned int index,
				enum v4l2_mbus_pixelcode *code)
{
	if (index)
+2 −2
Original line number Diff line number Diff line
@@ -701,13 +701,13 @@ static struct v4l2_subdev_core_ops mt9m001_subdev_core_ops = {
#endif
};

static int mt9m001_enum_fmt(struct v4l2_subdev *sd, int index,
static int mt9m001_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
			    enum v4l2_mbus_pixelcode *code)
{
	struct i2c_client *client = sd->priv;
	struct mt9m001 *mt9m001 = to_mt9m001(client);

	if ((unsigned int)index >= mt9m001->num_fmts)
	if (index >= mt9m001->num_fmts)
		return -EINVAL;

	*code = mt9m001->fmts[index].code;
+2 −2
Original line number Diff line number Diff line
@@ -999,10 +999,10 @@ static struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = {
#endif
};

static int mt9m111_enum_fmt(struct v4l2_subdev *sd, int index,
static int mt9m111_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
			    enum v4l2_mbus_pixelcode *code)
{
	if ((unsigned int)index >= ARRAY_SIZE(mt9m111_colour_fmts))
	if (index >= ARRAY_SIZE(mt9m111_colour_fmts))
		return -EINVAL;

	*code = mt9m111_colour_fmts[index].code;
+1 −1
Original line number Diff line number Diff line
@@ -798,7 +798,7 @@ static struct v4l2_subdev_core_ops mt9t031_subdev_core_ops = {
#endif
};

static int mt9t031_enum_fmt(struct v4l2_subdev *sd, int index,
static int mt9t031_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
			    enum v4l2_mbus_pixelcode *code)
{
	if (index)
+2 −2
Original line number Diff line number Diff line
@@ -1017,10 +1017,10 @@ static int mt9t112_try_fmt(struct v4l2_subdev *sd,
	return 0;
}

static int mt9t112_enum_fmt(struct v4l2_subdev *sd, int index,
static int mt9t112_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
			   enum v4l2_mbus_pixelcode *code)
{
	if ((unsigned int)index >= ARRAY_SIZE(mt9t112_cfmts))
	if (index >= ARRAY_SIZE(mt9t112_cfmts))
		return -EINVAL;

	*code = mt9t112_cfmts[index].code;
Loading