]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: vim2m: print device name after registering device
authorMatthew Majewski <mattwmajewski@gmail.com>
Wed, 19 Feb 2025 19:05:01 +0000 (14:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:40:52 +0000 (07:40 +0200)
commit 143d75583f2427f3a97dba62413c4f0604867ebf upstream.

Move the v4l2_info() call displaying the video device name after the
device is actually registered.

This fixes a bug where the driver was always displaying "/dev/video0"
since it was reading from the vfd before it was registered.

Fixes: cf7f34777a5b ("media: vim2m: Register video device after setting up internals")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/test-drivers/vim2m.c

index a24624353f9ed9d388dbcd291dce209f46d1fe0e..2f95d705009735d103f0b1c8aa5407fa621e17cd 100644 (file)
@@ -1326,9 +1326,6 @@ static int vim2m_probe(struct platform_device *pdev)
        vfd->v4l2_dev = &dev->v4l2_dev;
 
        video_set_drvdata(vfd, dev);
-       v4l2_info(&dev->v4l2_dev,
-                 "Device registered as /dev/video%d\n", vfd->num);
-
        platform_set_drvdata(pdev, dev);
 
        dev->m2m_dev = v4l2_m2m_init(&m2m_ops);
@@ -1355,6 +1352,9 @@ static int vim2m_probe(struct platform_device *pdev)
                goto error_m2m;
        }
 
+       v4l2_info(&dev->v4l2_dev,
+                 "Device registered as /dev/video%d\n", vfd->num);
+
 #ifdef CONFIG_MEDIA_CONTROLLER
        ret = v4l2_m2m_register_media_controller(dev->m2m_dev, vfd,
                                                 MEDIA_ENT_F_PROC_VIDEO_SCALER);