]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/saa7127.c
UBI: fix sparse warnings
[linux-2.6-omap-h63xx.git] / drivers / media / video / saa7127.c
index bd9c4f3ad02ee34a3a25ed19da3d7de00eef6380..9f986930490f7022326cd3c4a1b844b13a3e573d 100644 (file)
@@ -54,6 +54,7 @@
 #include <linux/i2c.h>
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
+#include <media/v4l2-chip-ident.h>
 #include <media/saa7127.h>
 
 static int debug = 0;
@@ -234,7 +235,7 @@ static struct i2c_reg_value saa7127_init_config_50hz[] = {
 
 struct saa7127_state {
        v4l2_std_id std;
-       enum v4l2_chip_ident ident;
+       u32 ident;
        enum saa7127_input_type input_type;
        enum saa7127_output_type output_type;
        int video_enable;
@@ -550,12 +551,12 @@ static int saa7127_command(struct i2c_client *client,
        struct v4l2_routing *route = arg;
 
        switch (cmd) {
-       case VIDIOC_S_STD:
+       case VIDIOC_INT_S_STD_OUTPUT:
                if (state->std == *(v4l2_std_id *)arg)
                        break;
                return saa7127_set_std(client, *(v4l2_std_id *)arg);
 
-       case VIDIOC_G_STD:
+       case VIDIOC_INT_G_STD_OUTPUT:
                *(v4l2_std_id *)arg = state->std;
                break;
 
@@ -619,7 +620,7 @@ static int saa7127_command(struct i2c_client *client,
        {
                struct v4l2_register *reg = arg;
 
-               if (reg->i2c_id != I2C_DRIVERID_SAA7127)
+               if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip))
                        return -EINVAL;
                if (!capable(CAP_SYS_ADMIN))
                        return -EPERM;
@@ -650,9 +651,8 @@ static int saa7127_command(struct i2c_client *client,
                break;
        }
 
-       case VIDIOC_INT_G_CHIP_IDENT:
-               *(enum v4l2_chip_ident *)arg = state->ident;
-               break;
+       case VIDIOC_G_CHIP_IDENT:
+               return v4l2_chip_ident_i2c_client(client, arg, state->ident, 0);
 
        default:
                return -EINVAL;