aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2006-07-29 16:18:06 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-07-29 16:22:36 -0400
commitd94fc9a08e51432d0d5fc0f74a4f705d7b49c251 (patch)
treecfef5643b6657bb775f6ab1e889e9a3d89bece28 /drivers/media/video/bt8xx
parent53dd8def52100ed8be4dae0cf1c2dc1f7e0fcd2c (diff)
V4L/DVB (4368): Bttv: use class_device_create_file and handle errors
Revert bttv-driver.c from video_device_create_file() to use class_device_create_file() again. video_device_create_file() is only available when V4L1 is on. Proper error checking is added for failure of class_device_create_file(). Will print error message and unroll partially created sysfs entries. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c8
1 files changed, 6 insertions, 2 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)
3923 goto err; 3923 goto err;
3924 printk(KERN_INFO "bttv%d: registered device video%d\n", 3924 printk(KERN_INFO "bttv%d: registered device video%d\n",
3925 btv->c.nr,btv->video_dev->minor & 0x1f); 3925 btv->c.nr,btv->video_dev->minor & 0x1f);
3926 3926 if (class_device_create_file(&btv->video_dev->class_dev,
3927 video_device_create_file(btv->video_dev, &class_device_attr_card); 3927 &class_device_attr_card)<0) {
3928 printk(KERN_ERR "bttv%d: class_device_create_file 'card' "
3929 "failed\n", btv->c.nr);
3930 goto err;
3931 }
3928 3932
3929 /* vbi */ 3933 /* vbi */
3930 btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi"); 3934 btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");