[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0d80df0a-0d20-5048-1e6d-ad913dc986c7@xs4all.nl>
Date: Tue, 7 Dec 2021 10:52:44 +0100
From: Hans Verkuil <hverkuil-cisco@...all.nl>
To: Ricardo Ribalda <ribalda@...omium.org>,
Nicolas Dufresne <nicolas@...fresne.ca>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
tfiga@...omium.org
Subject: Re: [PATCH v2 2/4] media: v4l2-dev.c: Allow driver-defined entity
names
On 07/12/2021 01:38, Ricardo Ribalda wrote:
> If the driver provides an name for an entity, use it.
> This is particularly useful for drivers that export multiple video
> devices for the same hardware (i.e. metadata and data).
>
> Suggested-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
Reviewed-by: Hans Verkuil <hverkuil-cisco@...all.nl>
Thanks!
Hans
> ---
> drivers/media/v4l2-core/v4l2-dev.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
> index d03ace324db0..4c00503b9349 100644
> --- a/drivers/media/v4l2-core/v4l2-dev.c
> +++ b/drivers/media/v4l2-core/v4l2-dev.c
> @@ -832,7 +832,9 @@ static int video_register_media_controller(struct video_device *vdev)
> }
>
> if (vdev->entity.function != MEDIA_ENT_F_UNKNOWN) {
> - vdev->entity.name = vdev->name;
> + /* Use entity names provided by the driver, if available. */
> + if (!vdev->entity.name)
> + vdev->entity.name = vdev->name;
>
> /* Needed just for backward compatibility with legacy MC API */
> vdev->entity.info.dev.major = VIDEO_MAJOR;
>
Powered by blists - more mailing lists