linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uvc: use usb_make_path to fill in usb_info
@ 2019-02-01  9:57 Hans Verkuil
  2019-02-14 12:52 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2019-02-01  9:57 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Laurent Pinchart

The uvc driver uses this function to fill in bus_info for VIDIOC_QUERYCAP,
so use the same function when filling in the bus_info for the media device.

The current implementation only fills in part of the info. E.g. if the full
bus_info is usb-0000:01:00.0-1.4.2, then the media bus_info only has 1.4.2.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index b62cbd800111..068cabf141c1 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2175,7 +2175,7 @@ static int uvc_probe(struct usb_interface *intf,
 	if (udev->serial)
 		strscpy(dev->mdev.serial, udev->serial,
 			sizeof(dev->mdev.serial));
-	strscpy(dev->mdev.bus_info, udev->devpath, sizeof(dev->mdev.bus_info));
+	usb_make_path(udev, dev->mdev.bus_info, sizeof(dev->mdev.bus_info));
 	dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
 	media_device_init(&dev->mdev);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] uvc: use usb_make_path to fill in usb_info
  2019-02-01  9:57 [PATCH] uvc: use usb_make_path to fill in usb_info Hans Verkuil
@ 2019-02-14 12:52 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2019-02-14 12:52 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List

Hi Hans,

Thank you for the patch.

On Fri, Feb 01, 2019 at 10:57:31AM +0100, Hans Verkuil wrote:
> The uvc driver uses this function to fill in bus_info for VIDIOC_QUERYCAP,
> so use the same function when filling in the bus_info for the media device.
> 
> The current implementation only fills in part of the info. E.g. if the full
> bus_info is usb-0000:01:00.0-1.4.2, then the media bus_info only has 1.4.2.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

This makes sense, even if in the long run we'll likely have to revisit
bus info.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and applied to my tree.

> ---
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index b62cbd800111..068cabf141c1 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2175,7 +2175,7 @@ static int uvc_probe(struct usb_interface *intf,
>  	if (udev->serial)
>  		strscpy(dev->mdev.serial, udev->serial,
>  			sizeof(dev->mdev.serial));
> -	strscpy(dev->mdev.bus_info, udev->devpath, sizeof(dev->mdev.bus_info));
> +	usb_make_path(udev, dev->mdev.bus_info, sizeof(dev->mdev.bus_info));
>  	dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
>  	media_device_init(&dev->mdev);
> 

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-14 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-01  9:57 [PATCH] uvc: use usb_make_path to fill in usb_info Hans Verkuil
2019-02-14 12:52 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).