[media] v4l2-ioctl: dbg_g/s_register: only match BRIDGE and SUBDEV types
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 29 May 2013 09:59:34 +0000 (06:59 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 13 Jun 2013 14:45:42 +0000 (11:45 -0300)
Drop support for V4L2_CHIP_MATCH_I2C_DRIVER/ADDR and V4L2_CHIP_MATCH_AC97
types. The following patches will remove support for those in the drivers
as well.
This means that bridge drivers no longer have to check for the match.type
field in their g/s_register implementations. Only if they also implement
g_chip_info do they still have to check the match.addr field, otherwise the
core will check for that as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/v4l2-ioctl.c

index f81bda1a48ec33ce603a1f741466bac726298e21..60b8c259da96bdc999a52eec679a3c15cd639420 100644 (file)
@@ -1807,7 +1807,8 @@ static int v4l_dbg_g_register(const struct v4l2_ioctl_ops *ops,
                                return v4l2_subdev_call(sd, core, g_register, p);
                return -EINVAL;
        }
-       if (ops->vidioc_g_register)
+       if (ops->vidioc_g_register && p->match.type == V4L2_CHIP_MATCH_BRIDGE &&
+           (ops->vidioc_g_chip_info || p->match.addr == 0))
                return ops->vidioc_g_register(file, fh, p);
        return -EINVAL;
 #else
@@ -1834,7 +1835,8 @@ static int v4l_dbg_s_register(const struct v4l2_ioctl_ops *ops,
                                return v4l2_subdev_call(sd, core, s_register, p);
                return -EINVAL;
        }
-       if (ops->vidioc_s_register)
+       if (ops->vidioc_s_register && p->match.type == V4L2_CHIP_MATCH_BRIDGE &&
+           (ops->vidioc_g_chip_info || p->match.addr == 0))
                return ops->vidioc_s_register(file, fh, p);
        return -EINVAL;
 #else