[06/11,media] v4l2-mc: use usb_make_path() to provide bus info
diff mbox

Message ID 9b8fed2b73514df87fced36481f84a0a745b674d.1455269986.git.mchehab@osg.samsung.com
State New
Headers show

Commit Message

Mauro Carvalho Chehab Feb. 12, 2016, 9:45 a.m. UTC
Report the bus info on the same way as VIDIOC_QUERYCAP. Also,
currently, it is reporting just PORT/DEV.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 drivers/media/v4l2-core/v4l2-mc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans Verkuil Feb. 12, 2016, 9:55 a.m. UTC | #1
On 02/12/2016 10:45 AM, Mauro Carvalho Chehab wrote:
> Report the bus info on the same way as VIDIOC_QUERYCAP. Also,
> currently, it is reporting just PORT/DEV.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> ---
>  drivers/media/v4l2-core/v4l2-mc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c
> index 649972e87621..ab5e42a86cc5 100644
> --- a/drivers/media/v4l2-core/v4l2-mc.c
> +++ b/drivers/media/v4l2-core/v4l2-mc.c
> @@ -79,7 +79,7 @@ struct media_device * __v4l2_mc_usb_media_device_init(struct usb_device *udev,
>  		strlcpy(mdev->model, "unknown model", sizeof(mdev->model));
>  	if (udev->serial)
>  		strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial));
> -	strcpy(mdev->bus_info, udev->devpath);
> +	usb_make_path(udev, mdev->bus_info, sizeof(mdev->bus_info));
>  	mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
>  	mdev->driver_version = LINUX_VERSION_CODE;
>  
> 

Please fold this in patch 02/11 and you can disregard my comment about
strcpy vs strlcpy.

Regards,

	Hans
--
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

Patch
diff mbox

diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c
index 649972e87621..ab5e42a86cc5 100644
--- a/drivers/media/v4l2-core/v4l2-mc.c
+++ b/drivers/media/v4l2-core/v4l2-mc.c
@@ -79,7 +79,7 @@  struct media_device * __v4l2_mc_usb_media_device_init(struct usb_device *udev,
 		strlcpy(mdev->model, "unknown model", sizeof(mdev->model));
 	if (udev->serial)
 		strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial));
-	strcpy(mdev->bus_info, udev->devpath);
+	usb_make_path(udev, mdev->bus_info, sizeof(mdev->bus_info));
 	mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
 	mdev->driver_version = LINUX_VERSION_CODE;