[media] em28xx: fix VIDIOC_DBG_G_CHIP_IDENT compliance errors
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 6 Sep 2012 12:53:08 +0000 (09:53 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Jan 2013 02:47:10 +0000 (00:47 -0200)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/em28xx/em28xx-video.c

index f025440bf95311dd5bbf6fb8f8d1d7ca65294dd9..b71df42aa7bb9389234480a91f3f5048b7cf9533 100644 (file)
@@ -1403,6 +1403,14 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,
 
        chip->ident = V4L2_IDENT_NONE;
        chip->revision = 0;
+       if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
+               if (v4l2_chip_match_host(&chip->match))
+                       chip->ident = V4L2_IDENT_NONE;
+               return 0;
+       }
+       if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
+           chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
+               return -EINVAL;
 
        v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_chip_ident, chip);