diff mbox series

staging/most/video: set device_caps in struct video_device

Message ID bf6e19b5-095c-ecac-fddb-91a1a65a2dee@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series staging/most/video: set device_caps in struct video_device | expand

Commit Message

Hans Verkuil June 26, 2019, 7:52 a.m. UTC
Instead of filling in the struct v4l2_capability device_caps
field, fill in the struct video_device device_caps field.

That way the V4L2 core knows what the capabilities of the
video device are.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
Hi Andrey,

I noticed this new staging V4L2 driver. FYI, please CC any future patches to
this driver to the linux-media@vger.kernel.org mailinglist as well so we can
review it. I'll post a review of this driver later today as well. In the
meantime, I'd like to get this patch in since during the upcoming 5.4 cycle
we will require that the device_caps field of struct video_device is set
correctly.

Greg, do you want to take this patch? After Andrey Acks it, of course.

Regards,

	Hans
---

Comments

Greg KH June 26, 2019, 8:19 a.m. UTC | #1
On Wed, Jun 26, 2019 at 09:52:49AM +0200, Hans Verkuil wrote:
> Instead of filling in the struct v4l2_capability device_caps
> field, fill in the struct video_device device_caps field.
> 
> That way the V4L2 core knows what the capabilities of the
> video device are.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> Hi Andrey,
> 
> I noticed this new staging V4L2 driver. FYI, please CC any future patches to
> this driver to the linux-media@vger.kernel.org mailinglist as well so we can
> review it. I'll post a review of this driver later today as well. In the
> meantime, I'd like to get this patch in since during the upcoming 5.4 cycle
> we will require that the device_caps field of struct video_device is set
> correctly.
> 
> Greg, do you want to take this patch? After Andrey Acks it, of course.

Yes, I will be glad to take it.

thanks,

greg k-h
Hans Verkuil June 26, 2019, 8:28 a.m. UTC | #2
On 6/26/19 10:19 AM, Greg Kroah-Hartman wrote:
> On Wed, Jun 26, 2019 at 09:52:49AM +0200, Hans Verkuil wrote:
>> Instead of filling in the struct v4l2_capability device_caps
>> field, fill in the struct video_device device_caps field.
>>
>> That way the V4L2 core knows what the capabilities of the
>> video device are.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> ---
>> Hi Andrey,
>>
>> I noticed this new staging V4L2 driver. FYI, please CC any future patches to
>> this driver to the linux-media@vger.kernel.org mailinglist as well so we can
>> review it. I'll post a review of this driver later today as well. In the
>> meantime, I'd like to get this patch in since during the upcoming 5.4 cycle
>> we will require that the device_caps field of struct video_device is set
>> correctly.
>>
>> Greg, do you want to take this patch? After Andrey Acks it, of course.
> 
> Yes, I will be glad to take it.

I'll post a v2 in a minute :-)

While reviewing the driver I found another issue in this code.

Regards,

	Hans

> 
> thanks,
> 
> greg k-h
>
diff mbox series

Patch

diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index adca250062e1..7d12ab6c60a1 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -250,11 +250,6 @@  static int vidioc_querycap(struct file *file, void *priv,
 	strlcpy(cap->card, "MOST", sizeof(cap->card));
 	snprintf(cap->bus_info, sizeof(cap->bus_info),
 		 "%s", mdev->iface->description);
-
-	cap->capabilities =
-		V4L2_CAP_READWRITE |
-		V4L2_CAP_TUNER |
-		V4L2_CAP_VIDEO_CAPTURE;
 	return 0;
 }

@@ -366,6 +361,8 @@  static const struct video_device comp_videodev_template = {
 	.release = video_device_release,
 	.ioctl_ops = &video_ioctl_ops,
 	.tvnorms = V4L2_STD_UNKNOWN,
+	.device_caps = V4L2_CAP_READWRITE | V4L2_CAP_TUNER |
+		       V4L2_CAP_VIDEO_CAPTURE,
 };

 /**************************************************************************/