]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
V4L/DVB: v4l2-subdev.h: fix enum_mbus_fmt prototype
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 8 May 2010 20:55:00 +0000 (17:55 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 1 Jun 2010 04:21:40 +0000 (01:21 -0300)
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: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
17 files changed:
drivers/media/video/ak881x.c
drivers/media/video/mt9m001.c
drivers/media/video/mt9m111.c
drivers/media/video/mt9t031.c
drivers/media/video/mt9t112.c
drivers/media/video/mt9v022.c
drivers/media/video/mx3_camera.c
drivers/media/video/ov772x.c
drivers/media/video/ov9640.c
drivers/media/video/pxa_camera.c
drivers/media/video/rj54n1cb0c.c
drivers/media/video/sh_mobile_ceu_camera.c
drivers/media/video/soc_camera.c
drivers/media/video/soc_camera_platform.c
drivers/media/video/tw9910.c
include/media/soc_camera.h
include/media/v4l2-subdev.h

index 35390d4717b97a4f5824a69a4c2545b236485323..3006a2c80f475106927040b398d5cf5077868aaa 100644 (file)
@@ -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)
index b62c0bd3f8ea013de803ceac7f3f25f1c7a9bb57..992ab8cb89ae0bc59671b4cb57f1d0617e484002 100644 (file)
@@ -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;
index d35f536f9fc37fd6729211d9610adbfa2334c77e..bac0c5d4070c9a56cdfe79a8bbdeb2947b908c51 100644 (file)
@@ -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;
index 78b4e091d2d5f527dd76db13a072bb339289fa84..f26933a8fd8a5022825e1b1e689aa1cc1e19d69c 100644 (file)
@@ -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)
index 7438f8d775ba7fa09fb32f9ad2f0a8934606afb5..abe5505b9f79bc87c757582c8b1774d3893b8692 100644 (file)
@@ -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;
index e5bae4c9393b8b9e3d4a0c8acbcf770d627fe3bc..c409d05d465a57ea8dce0f942fe436a8081436f1 100644 (file)
@@ -838,13 +838,13 @@ static struct v4l2_subdev_core_ops mt9v022_subdev_core_ops = {
 #endif
 };
 
-static int mt9v022_enum_fmt(struct v4l2_subdev *sd, int index,
+static int mt9v022_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                            enum v4l2_mbus_pixelcode *code)
 {
        struct i2c_client *client = sd->priv;
        struct mt9v022 *mt9v022 = to_mt9v022(client);
 
-       if ((unsigned int)index >= mt9v022->num_fmts)
+       if (index >= mt9v022->num_fmts)
                return -EINVAL;
 
        *code = mt9v022->fmts[index].code;
index d477e3058002c27f996c445b1980e2a4e1ae24ea..a9be14c239124a06185c3ff6c43af44bb47d4f83 100644 (file)
@@ -672,7 +672,7 @@ static bool mx3_camera_packing_supported(const struct soc_mbus_pixelfmt *fmt)
                 fmt->packing == SOC_MBUS_PACKING_EXTEND16);
 }
 
-static int mx3_camera_get_formats(struct soc_camera_device *icd, int idx,
+static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int idx,
                                  struct soc_camera_format_xlate *xlate)
 {
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
@@ -689,7 +689,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, int idx,
        fmt = soc_mbus_get_fmtdesc(code);
        if (!fmt) {
                dev_err(icd->dev.parent,
-                       "Invalid format code #%d: %d\n", idx, code);
+                       "Invalid format code #%u: %d\n", idx, code);
                return 0;
        }
 
index 7f8ece30c77ba790cb38c314783544a0de0e162d..86b0186c360c71243c8c3b41bf4f9cc9bc39add2 100644 (file)
@@ -1092,10 +1092,10 @@ static struct v4l2_subdev_core_ops ov772x_subdev_core_ops = {
 #endif
 };
 
-static int ov772x_enum_fmt(struct v4l2_subdev *sd, int index,
+static int ov772x_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                           enum v4l2_mbus_pixelcode *code)
 {
-       if ((unsigned int)index >= ARRAY_SIZE(ov772x_cfmts))
+       if (index >= ARRAY_SIZE(ov772x_cfmts))
                return -EINVAL;
 
        *code = ov772x_cfmts[index].code;
index 36599a65f54851759f47a5a412bd5fdc629b8e1f..58811c044c6a6e75ff4afc54ef35419ee62b0717 100644 (file)
@@ -614,10 +614,10 @@ static int ov9640_try_fmt(struct v4l2_subdev *sd,
        return 0;
 }
 
-static int ov9640_enum_fmt(struct v4l2_subdev *sd, int index,
+static int ov9640_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                           enum v4l2_mbus_pixelcode *code)
 {
-       if ((unsigned int)index >= ARRAY_SIZE(ov9640_codes))
+       if (index >= ARRAY_SIZE(ov9640_codes))
                return -EINVAL;
 
        *code = ov9640_codes[index];
index 7fe70e7186565deb9155f592d30eae7284603771..fb242f6cfb1f23b313df0ae80510ef8ec6042539 100644 (file)
@@ -1247,7 +1247,7 @@ static bool pxa_camera_packing_supported(const struct soc_mbus_pixelfmt *fmt)
                 fmt->packing == SOC_MBUS_PACKING_EXTEND16);
 }
 
-static int pxa_camera_get_formats(struct soc_camera_device *icd, int idx,
+static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int idx,
                                  struct soc_camera_format_xlate *xlate)
 {
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
@@ -1264,7 +1264,7 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, int idx,
 
        fmt = soc_mbus_get_fmtdesc(code);
        if (!fmt) {
-               dev_err(dev, "Invalid format code #%d: %d\n", idx, code);
+               dev_err(dev, "Invalid format code #%u: %d\n", idx, code);
                return 0;
        }
 
index bbd9c11e2c5a721436230f6656f83806058ade54..64eb05ce56039ce09047c77801cf2f370726cee0 100644 (file)
@@ -481,10 +481,10 @@ static int reg_write_multiple(struct i2c_client *client,
        return 0;
 }
 
-static int rj54n1_enum_fmt(struct v4l2_subdev *sd, int index,
+static int rj54n1_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                           enum v4l2_mbus_pixelcode *code)
 {
-       if ((unsigned int)index >= ARRAY_SIZE(rj54n1_colour_fmts))
+       if (index >= ARRAY_SIZE(rj54n1_colour_fmts))
                return -EINVAL;
 
        *code = rj54n1_colour_fmts[index].code;
index 4ac3b482fbb49cd206b8ec4c2db3017535525411..961bfa2fea97eb9f65a5900d36fcc0d181e2ffa2 100644 (file)
@@ -878,7 +878,7 @@ static bool sh_mobile_ceu_packing_supported(const struct soc_mbus_pixelfmt *fmt)
 
 static int client_g_rect(struct v4l2_subdev *sd, struct v4l2_rect *rect);
 
-static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, int idx,
+static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int idx,
                                     struct soc_camera_format_xlate *xlate)
 {
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
@@ -897,7 +897,7 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, int idx,
        fmt = soc_mbus_get_fmtdesc(code);
        if (!fmt) {
                dev_err(icd->dev.parent,
-                       "Invalid format code #%d: %d\n", idx, code);
+                       "Invalid format code #%u: %d\n", idx, code);
                return -EINVAL;
        }
 
index db1ca0e90d7611e80905339d7730c2dc00668b86..475757bfd7ba5bbd0cff11ecf8ab4f963d5174f9 100644 (file)
@@ -200,7 +200,8 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd)
 {
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
        struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
-       int i, fmts = 0, raw_fmts = 0, ret;
+       unsigned int i, fmts = 0, raw_fmts = 0;
+       int ret;
        enum v4l2_mbus_pixelcode code;
 
        while (!v4l2_subdev_call(sd, video, enum_mbus_fmt, raw_fmts, &code))
index 10b003a8be83c21fbf7b7964c6dc142c8c0e93f3..248c986f0989744bce6497d699fe4d43d038b850 100644 (file)
@@ -71,7 +71,7 @@ static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd,
 
 static struct v4l2_subdev_core_ops platform_subdev_core_ops;
 
-static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, int index,
+static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                                        enum v4l2_mbus_pixelcode *code)
 {
        struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
index 76be733eabfd4d3f7b4bc474219a6f0a9c8fb5ea..2f3b1942e0279a8a71c291a3d6e5e84417e926fc 100644 (file)
@@ -903,7 +903,7 @@ static struct v4l2_subdev_core_ops tw9910_subdev_core_ops = {
 #endif
 };
 
-static int tw9910_enum_fmt(struct v4l2_subdev *sd, int index,
+static int tw9910_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                           enum v4l2_mbus_pixelcode *code)
 {
        if (index)
index c9a5bbfa6ab5f91cdab0e90e548fea322bd47f0a..b8289c2f609b431cf6da04388bdfd679a2db65c8 100644 (file)
@@ -66,7 +66,7 @@ struct soc_camera_host_ops {
         * .get_formats() fail, .put_formats() will not be called at all, the
         * failing .get_formats() must then clean up internally.
         */
-       int (*get_formats)(struct soc_camera_device *, int,
+       int (*get_formats)(struct soc_camera_device *, unsigned int,
                           struct soc_camera_format_xlate *);
        void (*put_formats)(struct soc_camera_device *);
        int (*cropcap)(struct soc_camera_device *, struct v4l2_cropcap *);
index a88889355ae0a4bb6edb6e4fc05893eab551d029..02c6f4d11ed3654d76e2908983b26353361d2b1a 100644 (file)
@@ -246,7 +246,7 @@ struct v4l2_subdev_video_ops {
                        struct v4l2_dv_timings *timings);
        int (*g_dv_timings)(struct v4l2_subdev *sd,
                        struct v4l2_dv_timings *timings);
-       int (*enum_mbus_fmt)(struct v4l2_subdev *sd, int index,
+       int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index,
                             enum v4l2_mbus_pixelcode *code);
        int (*g_mbus_fmt)(struct v4l2_subdev *sd,
                          struct v4l2_mbus_framefmt *fmt);