From f2d8b6917f3bcfb3190eb80567fea71a9b59dbd3 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 22 Jan 2022 13:23:18 +0000 Subject: media: v4l: ioctl: Set bus_info in v4l_querycap() The bus_info field is set by most drivers based on the type of the device bus as well as the name of the device. Do this in v4l_querycap() so drivers don't need to. This keeps compatibility with non-default and silly bus_info. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-ioctl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/media/v4l2-core/v4l2-ioctl.c') diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 96e307fe3aab..db5947fbd9a9 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -18,6 +18,7 @@ #include +#include /* for media_set_bus_info() */ #include #include #include @@ -1052,6 +1053,9 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops, cap->device_caps = vfd->device_caps; cap->capabilities = vfd->device_caps | V4L2_CAP_DEVICE_CAPS; + media_set_bus_info(cap->bus_info, sizeof(cap->bus_info), + vfd->dev_parent); + ret = ops->vidioc_querycap(file, fh, cap); /* -- cgit v1.2.3