diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2006-07-25 09:32:31 -0300 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2006-07-25 09:32:31 -0300 |
commit | 6a08e4d1f06580b112a2e493d69cbd65be8f50b3 (patch) | |
tree | 16d6f8d3bf6b55b7dd86f9a814001a248103afda /linux/drivers/media | |
parent | eae539a732ce1383b14bea7a37e7204cba2805fc (diff) | |
download | mediapointer-dvb-s2-6a08e4d1f06580b112a2e493d69cbd65be8f50b3.tar.gz mediapointer-dvb-s2-6a08e4d1f06580b112a2e493d69cbd65be8f50b3.tar.bz2 |
bttv: use class_device_create_file and handle errors
From: Trent Piepho <xyzzy@speakeasy.org>
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>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index da7fab7aa..b0342f583 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -3957,8 +3957,12 @@ static int __devinit bttv_register_video(struct bttv *btv) printk(KERN_INFO "bttv%d: registered device video%d\n", btv->c.nr,btv->video_dev->minor & 0x1f); #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) - - 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; + } #endif /* vbi */ |