media: imx: set a media_device bus_info string
authorMartin Kepplinger <martin.kepplinger@puri.sm>
Wed, 8 Sep 2021 08:47:46 +0000 (10:47 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:59 +0000 (10:07 +0200)
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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/imx/imx-media-dev-common.c

index d006e96..80b69a9 100644 (file)
@@ -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);