summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c8
-rw-r--r--drivers/media/video/videodev.c7
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 6db5e4e73397..20dff7c316eb 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3923,8 +3923,12 @@ static int __devinit bttv_register_video(struct bttv *btv)
goto err;
printk(KERN_INFO "bttv%d: registered device video%d\n",
btv->c.nr,btv->video_dev->minor & 0x1f);
-
- video_device_create_file(btv->video_dev, &class_device_attr_card);
+ if (class_device_create_file(&btv->video_dev->class_dev,
+ &class_device_attr_card)<0) {
+ printk(KERN_ERR "bttv%d: class_device_create_file 'card' "
+ "failed\n", btv->c.nr);
+ goto err;
+ }
/* vbi */
btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index caa4f736468a..46848e2ae476 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -1578,12 +1578,13 @@ int video_register_device(struct video_device *vfd, int type, int nr)
if (ret) {
printk(KERN_ERR "%s: class_device_register failed\n",
__FUNCTION__);
- return ret;
+ goto fail_minor;
}
ret = class_device_create_file(&vfd->class_dev, &class_device_attr_name);
if (ret < 0) {
- printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
- return ret;
+ printk(KERN_ERR "%s: class_device_create_file 'name' failed\n",
+ __FUNCTION__);
+ goto fail_classdev;
}
#if 1
OpenPOWER on IntegriCloud