From: Hans Verkuil <hans.verk...@cisco.com>

That way drivers do not need to fill in the name themselves for bridge address 
0.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>
---
 drivers/media/v4l2-core/v4l2-ioctl.c |    8 ++++----
 1 file 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:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to