aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-03-19 08:34:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-14 18:58:59 -0400
commit280847b532433ffe7a22795f926327805a127162 (patch)
tree13ee3b26ffca1a35cb628edd29b0b3dba95df430
parent97caa318b3ced2241cf1eda772a72c9c2ea19abb (diff)
[media] hdpvr: register the video node at the end of probe
Video nodes can be used at once after registration, so make sure the full initialization is done before registering them. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-core.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 73195fe7871c..248835b92d73 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -386,12 +386,6 @@ static int hdpvr_probe(struct usb_interface *interface,
386 } 386 }
387 mutex_unlock(&dev->io_mutex); 387 mutex_unlock(&dev->io_mutex);
388 388
389 if (hdpvr_register_videodev(dev, &interface->dev,
390 video_nr[atomic_inc_return(&dev_nr)])) {
391 v4l2_err(&dev->v4l2_dev, "registering videodev failed\n");
392 goto error;
393 }
394
395#if IS_ENABLED(CONFIG_I2C) 389#if IS_ENABLED(CONFIG_I2C)
396 retval = hdpvr_register_i2c_adapter(dev); 390 retval = hdpvr_register_i2c_adapter(dev);
397 if (retval < 0) { 391 if (retval < 0) {
@@ -414,6 +408,13 @@ static int hdpvr_probe(struct usb_interface *interface,
414 } 408 }
415#endif 409#endif
416 410
411 retval = hdpvr_register_videodev(dev, &interface->dev,
412 video_nr[atomic_inc_return(&dev_nr)]);
413 if (retval < 0) {
414 v4l2_err(&dev->v4l2_dev, "registering videodev failed\n");
415 goto error;
416 }
417
417 /* let the user know what node this device is now attached to */ 418 /* let the user know what node this device is now attached to */
418 v4l2_info(&dev->v4l2_dev, "device now attached to %s\n", 419 v4l2_info(&dev->v4l2_dev, "device now attached to %s\n",
419 video_device_node_name(dev->video_dev)); 420 video_device_node_name(dev->video_dev));