summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-04-06 09:06:13 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-14 22:46:49 (GMT)
commit0f0fe4b9f6f32b90c82345b97da2977b84e14414 (patch)
treedb645e61e54d5ce9838cf65f4a99a3fd43d1e78c
parent3eef25107cab65a1158b11ba373fb9b4fc25b4b8 (diff)
downloadlinux-0f0fe4b9f6f32b90c82345b97da2977b84e14414.tar.xz
[media] v4l2-ioctl: fill in name before calling vidioc_g_chip_name
That way drivers do not need to fill in the name themselves for bridge address 0. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/v4l2-core/v4l2-ioctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 7a96162..c48d0ac 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1869,16 +1869,16 @@ static int v4l_dbg_g_chip_name(const struct v4l2_ioctl_ops *ops,
p->flags |= V4L2_CHIP_FL_WRITABLE;
if (ops->vidioc_g_register)
p->flags |= V4L2_CHIP_FL_READABLE;
- if (ops->vidioc_g_chip_name)
- return ops->vidioc_g_chip_name(file, fh, arg);
- if (p->match.addr)
- return -EINVAL;
if (vfd->v4l2_dev)
strlcpy(p->name, vfd->v4l2_dev->name, sizeof(p->name));
else if (vfd->parent)
strlcpy(p->name, vfd->parent->driver->name, sizeof(p->name));
else
strlcpy(p->name, "bridge", sizeof(p->name));
+ if (ops->vidioc_g_chip_name)
+ return ops->vidioc_g_chip_name(file, fh, arg);
+ if (p->match.addr)
+ return -EINVAL;
return 0;
case V4L2_CHIP_MATCH_SUBDEV: