[media] media: i2c: ths7303: remove unnecessary function ths7303_setup()
authorLad, Prabhakar <prabhakar.csengg@gmail.com>
Sat, 25 May 2013 16:39:35 +0000 (13:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 13 Jun 2013 14:41:47 +0000 (11:41 -0300)
the ths7303_setup() was doing the same thing as ths7303_setval()
except that ths7303_setval() sets it to some particular mode.
This patch removes ths7303_setup() function and calls ths7303_setval()
in the probe setting the device to 480I_576I filter mode in the probe.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/i2c/ths7303.c

index 8cddcd0cfa0947474988317957a6a92c6030c4cc..af06187c74f81650268512a5bdf8aca859aae2c3 100644 (file)
@@ -349,30 +349,6 @@ static const struct v4l2_subdev_ops ths7303_ops = {
        .video  = &ths7303_video_ops,
 };
 
-static int ths7303_setup(struct v4l2_subdev *sd)
-{
-       struct ths7303_state *state = to_state(sd);
-       struct ths7303_platform_data *pdata = &state->pdata;
-       int ret;
-       u8 mask;
-
-       mask = 0xf8;
-
-       ret = ths7303_write(sd, THS7303_CHANNEL_1, pdata->ch_1 & mask);
-       if (ret)
-               return ret;
-
-       ret = ths7303_write(sd, THS7303_CHANNEL_2, pdata->ch_2 & mask);
-       if (ret)
-               return ret;
-
-       ret = ths7303_write(sd, THS7303_CHANNEL_3, pdata->ch_3 & mask);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-
 static int ths7303_probe(struct i2c_client *client,
                        const struct i2c_device_id *id)
 {
@@ -402,9 +378,10 @@ static int ths7303_probe(struct i2c_client *client,
        /* store the driver data to differntiate the chip */
        state->driver_data = (int)id->driver_data;
 
-       if (ths7303_setup(sd) < 0) {
-               v4l_err(client, "init failed\n");
-               return -EIO;
+       /* set to default 480I_576I filter mode */
+       if (ths7303_setval(sd, THS7303_FILTER_MODE_480I_576I) < 0) {
+               v4l_err(client, "Setting to 480I_576I filter mode failed!\n");
+               return -EINVAL;
        }
 
        return 0;