Commit 143d7558 authored by Matthew Majewski's avatar Matthew Majewski Committed by Hans Verkuil
Browse files

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: cf7f3477 ("media: vim2m: Register video device after setting up internals")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMatthew Majewski <mattwmajewski@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
parent 20889dde
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1314,9 +1314,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);
@@ -1343,6 +1340,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);