Commit 092bc21e authored by Hans Verkuil's avatar Hans Verkuil Committed by Greg Kroah-Hartman

media: hdpvr: register the video node at the end of probe

commit 280847b5 upstream.

Video nodes can be used at once after registration, so make sure the full
initialization is done before registering them.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Jianguo Wu <wujianguo@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9ef2f224
......@@ -385,12 +385,6 @@ static int hdpvr_probe(struct usb_interface *interface,
}
mutex_unlock(&dev->io_mutex);
if (hdpvr_register_videodev(dev, &interface->dev,
video_nr[atomic_inc_return(&dev_nr)])) {
v4l2_err(&dev->v4l2_dev, "registering videodev failed\n");
goto error;
}
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
retval = hdpvr_register_i2c_adapter(dev);
if (retval < 0) {
......@@ -411,6 +405,13 @@ static int hdpvr_probe(struct usb_interface *interface,
}
#endif
retval = hdpvr_register_videodev(dev, &interface->dev,
video_nr[atomic_inc_return(&dev_nr)]);
if (retval < 0) {
v4l2_err(&dev->v4l2_dev, "registering videodev failed\n");
goto error;
}
/* let the user know what node this device is now attached to */
v4l2_info(&dev->v4l2_dev, "device now attached to %s\n",
video_device_node_name(dev->video_dev));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment