diff mbox series

media: imx: set a media_device bus_info string

Message ID 20210908084746.243359-1-martin.kepplinger@puri.sm (mailing list archive)
State New, archived
Headers show
Series media: imx: set a media_device bus_info string | expand

Commit Message

Martin Kepplinger Sept. 8, 2021, 8:47 a.m. UTC
some tools like v4l2-compliance let users select a media device based
on the bus_info string which can be quite convenient. Use a unique
string for that.

This also fixes the following v4l2-compliance warning:
warn: v4l2-test-media.cpp(52): empty bus_info

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
---
 drivers/staging/media/imx/imx-media-dev-common.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Laurent Pinchart Sept. 8, 2021, 10:37 p.m. UTC | #1
Hi Martin,

Thank you for the patch.

On Wed, Sep 08, 2021 at 10:47:46AM +0200, Martin Kepplinger wrote:
> some tools like v4l2-compliance let users select a media device based

s/some/Some/

I'll fix then when applying the patch to my tree.

> on the bus_info string which can be quite convenient. Use a unique
> string for that.
> 
> This also fixes the following v4l2-compliance warning:
> warn: v4l2-test-media.cpp(52): empty bus_info
> 
> Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>

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

> ---
>  drivers/staging/media/imx/imx-media-dev-common.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c
> index d006e961d8f4..80b69a9a752c 100644
> --- a/drivers/staging/media/imx/imx-media-dev-common.c
> +++ b/drivers/staging/media/imx/imx-media-dev-common.c
> @@ -367,6 +367,8 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev,
>  	imxmd->v4l2_dev.notify = imx_media_notify;
>  	strscpy(imxmd->v4l2_dev.name, "imx-media",
>  		sizeof(imxmd->v4l2_dev.name));
> +	snprintf(imxmd->md.bus_info, sizeof(imxmd->md.bus_info),
> +		 "platform:%s", dev_name(imxmd->md.dev));
>  
>  	media_device_init(&imxmd->md);
>
diff mbox series

Patch

diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c
index d006e961d8f4..80b69a9a752c 100644
--- a/drivers/staging/media/imx/imx-media-dev-common.c
+++ b/drivers/staging/media/imx/imx-media-dev-common.c
@@ -367,6 +367,8 @@  struct imx_media_dev *imx_media_dev_init(struct device *dev,
 	imxmd->v4l2_dev.notify = imx_media_notify;
 	strscpy(imxmd->v4l2_dev.name, "imx-media",
 		sizeof(imxmd->v4l2_dev.name));
+	snprintf(imxmd->md.bus_info, sizeof(imxmd->md.bus_info),
+		 "platform:%s", dev_name(imxmd->md.dev));
 
 	media_device_init(&imxmd->md);