All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vimc: fill in bus_info in media_device_info
@ 2019-01-30 13:43 Hans Verkuil
  2019-02-07 15:15 ` Helen Koike
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2019-01-30 13:43 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Helen Koike

It is good practice to fill in bus_info.

Also just use 'platform:vimc' when filling in the bus_info in querycap:
the bus_info has nothing to do with the video device name.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c
index aaeddf24b042..550aa426ae5e 100644
--- a/drivers/media/platform/vimc/vimc-capture.c
+++ b/drivers/media/platform/vimc/vimc-capture.c
@@ -69,12 +69,10 @@ struct vimc_cap_buffer {
 static int vimc_cap_querycap(struct file *file, void *priv,
 			     struct v4l2_capability *cap)
 {
-	struct vimc_cap_device *vcap = video_drvdata(file);
-
 	strscpy(cap->driver, VIMC_PDEV_NAME, sizeof(cap->driver));
 	strscpy(cap->card, KBUILD_MODNAME, sizeof(cap->card));
 	snprintf(cap->bus_info, sizeof(cap->bus_info),
-		 "platform:%s", vcap->vdev.v4l2_dev->name);
+		 "platform:%s", VIMC_PDEV_NAME);

 	return 0;
 }
diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
index bf19f1f9795e..c2fdf3ea67ed 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -318,6 +318,8 @@ static int vimc_probe(struct platform_device *pdev)
 	/* Initialize media device */
 	strscpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME,
 		sizeof(vimc->mdev.model));
+	snprintf(vimc->mdev.bus_info, sizeof(vimc->mdev.bus_info),
+		 "platform:%s", VIMC_PDEV_NAME);
 	vimc->mdev.dev = &pdev->dev;
 	media_device_init(&vimc->mdev);


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

* Re: [PATCH] vimc: fill in bus_info in media_device_info
  2019-01-30 13:43 [PATCH] vimc: fill in bus_info in media_device_info Hans Verkuil
@ 2019-02-07 15:15 ` Helen Koike
  0 siblings, 0 replies; 2+ messages in thread
From: Helen Koike @ 2019-02-07 15:15 UTC (permalink / raw)
  To: Hans Verkuil, Linux Media Mailing List



On 1/30/19 11:43 AM, Hans Verkuil wrote:
> It is good practice to fill in bus_info.
> 
> Also just use 'platform:vimc' when filling in the bus_info in querycap:
> the bus_info has nothing to do with the video device name.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Acked-by: Helen Koike <helen.koike@collabora.com>

Thanks
Helen

> ---
> diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c
> index aaeddf24b042..550aa426ae5e 100644
> --- a/drivers/media/platform/vimc/vimc-capture.c
> +++ b/drivers/media/platform/vimc/vimc-capture.c
> @@ -69,12 +69,10 @@ struct vimc_cap_buffer {
>  static int vimc_cap_querycap(struct file *file, void *priv,
>  			     struct v4l2_capability *cap)
>  {
> -	struct vimc_cap_device *vcap = video_drvdata(file);
> -
>  	strscpy(cap->driver, VIMC_PDEV_NAME, sizeof(cap->driver));
>  	strscpy(cap->card, KBUILD_MODNAME, sizeof(cap->card));
>  	snprintf(cap->bus_info, sizeof(cap->bus_info),
> -		 "platform:%s", vcap->vdev.v4l2_dev->name);
> +		 "platform:%s", VIMC_PDEV_NAME);
> 
>  	return 0;
>  }
> diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
> index bf19f1f9795e..c2fdf3ea67ed 100644
> --- a/drivers/media/platform/vimc/vimc-core.c
> +++ b/drivers/media/platform/vimc/vimc-core.c
> @@ -318,6 +318,8 @@ static int vimc_probe(struct platform_device *pdev)
>  	/* Initialize media device */
>  	strscpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME,
>  		sizeof(vimc->mdev.model));
> +	snprintf(vimc->mdev.bus_info, sizeof(vimc->mdev.bus_info),
> +		 "platform:%s", VIMC_PDEV_NAME);
>  	vimc->mdev.dev = &pdev->dev;
>  	media_device_init(&vimc->mdev);
> 

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

end of thread, other threads:[~2019-02-07 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 13:43 [PATCH] vimc: fill in bus_info in media_device_info Hans Verkuil
2019-02-07 15:15 ` Helen Koike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.