diff mbox

usb: gadget: f_uvc fix transition to video_ioctl2

Message ID 1409152598-21046-1-git-send-email-andrzej.p@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrzej Pietrasiewicz Aug. 27, 2014, 3:16 p.m. UTC
UVC video node is a TX device from the point of view of the gadget,
so we cannot rely on the video struct being filled with zeros, because
VFL_DIR_TX is actually 1.

Suggested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
---
 drivers/usb/gadget/function/f_uvc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Aug. 28, 2014, 11:28 a.m. UTC | #1
Hi Andrzej,

Thank you for the patch.

On Wednesday 27 August 2014 17:16:38 Andrzej Pietrasiewicz wrote:
> UVC video node is a TX device from the point of view of the gadget,
> so we cannot rely on the video struct being filled with zeros, because
> VFL_DIR_TX is actually 1.
> 
> Suggested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
> ---
>  drivers/usb/gadget/function/f_uvc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/gadget/function/f_uvc.c
> b/drivers/usb/gadget/function/f_uvc.c index 5209105..95dc1c6 100644
> --- a/drivers/usb/gadget/function/f_uvc.c
> +++ b/drivers/usb/gadget/function/f_uvc.c
> @@ -411,6 +411,7 @@ uvc_register_video(struct uvc_device *uvc)
>  	video->fops = &uvc_v4l2_fops;
>  	video->ioctl_ops = &uvc_v4l2_ioctl_ops;
>  	video->release = video_device_release;
> +	video->vfl_dir = VFL_DIR_TX;

Do you have any objection against squashing this patch into "usb: gadget: 
f_uvc: Move to video_ioctl2" ?

>  	strlcpy(video->name, cdev->gadget->name, sizeof(video->name));
> 
>  	uvc->vdev = video;
Andrzej Pietrasiewicz Aug. 28, 2014, 2:39 p.m. UTC | #2
W dniu 28.08.2014 o 13:28, Laurent Pinchart pisze:

<snip>

>> diff --git a/drivers/usb/gadget/function/f_uvc.c
>> b/drivers/usb/gadget/function/f_uvc.c index 5209105..95dc1c6 100644
>> --- a/drivers/usb/gadget/function/f_uvc.c
>> +++ b/drivers/usb/gadget/function/f_uvc.c
>> @@ -411,6 +411,7 @@ uvc_register_video(struct uvc_device *uvc)
>>   	video->fops = &uvc_v4l2_fops;
>>   	video->ioctl_ops = &uvc_v4l2_ioctl_ops;
>>   	video->release = video_device_release;
>> +	video->vfl_dir = VFL_DIR_TX;
>
> Do you have any objection against squashing this patch into "usb: gadget:
> f_uvc: Move to video_ioctl2" ?
>
Not at all. Feel free to squash it.

AP

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felipe Balbi Aug. 28, 2014, 2:48 p.m. UTC | #3
On Thu, Aug 28, 2014 at 04:39:27PM +0200, Andrzej Pietrasiewicz wrote:
> W dniu 28.08.2014 o 13:28, Laurent Pinchart pisze:
> 
> <snip>
> 
> >>diff --git a/drivers/usb/gadget/function/f_uvc.c
> >>b/drivers/usb/gadget/function/f_uvc.c index 5209105..95dc1c6 100644
> >>--- a/drivers/usb/gadget/function/f_uvc.c
> >>+++ b/drivers/usb/gadget/function/f_uvc.c
> >>@@ -411,6 +411,7 @@ uvc_register_video(struct uvc_device *uvc)
> >>  	video->fops = &uvc_v4l2_fops;
> >>  	video->ioctl_ops = &uvc_v4l2_ioctl_ops;
> >>  	video->release = video_device_release;
> >>+	video->vfl_dir = VFL_DIR_TX;
> >
> >Do you have any objection against squashing this patch into "usb: gadget:
> >f_uvc: Move to video_ioctl2" ?
> >
> Not at all. Feel free to squash it.

This is in my testing/fixes, though. I'll drop it from there.
diff mbox

Patch

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 5209105..95dc1c6 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -411,6 +411,7 @@  uvc_register_video(struct uvc_device *uvc)
 	video->fops = &uvc_v4l2_fops;
 	video->ioctl_ops = &uvc_v4l2_ioctl_ops;
 	video->release = video_device_release;
+	video->vfl_dir = VFL_DIR_TX;
 	strlcpy(video->name, cdev->gadget->name, sizeof(video->name));
 
 	uvc->vdev = video;