Skip to content

Commit 143d755

Browse files
Matthew Majewskihverkuil
authored andcommitted
media: vim2m: print device name after registering device
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: cf7f347 ("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>
1 parent 20889dd commit 143d755

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/media/test-drivers/vim2m.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,9 +1314,6 @@ static int vim2m_probe(struct platform_device *pdev)
13141314
vfd->v4l2_dev = &dev->v4l2_dev;
13151315

13161316
video_set_drvdata(vfd, dev);
1317-
v4l2_info(&dev->v4l2_dev,
1318-
"Device registered as /dev/video%d\n", vfd->num);
1319-
13201317
platform_set_drvdata(pdev, dev);
13211318

13221319
dev->m2m_dev = v4l2_m2m_init(&m2m_ops);
@@ -1343,6 +1340,9 @@ static int vim2m_probe(struct platform_device *pdev)
13431340
goto error_m2m;
13441341
}
13451342

1343+
v4l2_info(&dev->v4l2_dev,
1344+
"Device registered as /dev/video%d\n", vfd->num);
1345+
13461346
#ifdef CONFIG_MEDIA_CONTROLLER
13471347
ret = v4l2_m2m_register_media_controller(dev->m2m_dev, vfd,
13481348
MEDIA_ENT_F_PROC_VIDEO_SCALER);

0 commit comments

Comments
 (0)