diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2006-07-29 16:18:06 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-07-29 16:22:36 -0400 |
commit | d94fc9a08e51432d0d5fc0f74a4f705d7b49c251 (patch) | |
tree | cfef5643b6657bb775f6ab1e889e9a3d89bece28 /drivers/media/video/videodev.c | |
parent | 53dd8def52100ed8be4dae0cf1c2dc1f7e0fcd2c (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/videodev.c')
-rw-r--r-- | drivers/media/video/videodev.c | 7 |
1 files changed, 4 insertions, 3 deletions
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) | |||
1578 | if (ret) { | 1578 | if (ret) { |
1579 | printk(KERN_ERR "%s: class_device_register failed\n", | 1579 | printk(KERN_ERR "%s: class_device_register failed\n", |
1580 | __FUNCTION__); | 1580 | __FUNCTION__); |
1581 | return ret; | 1581 | goto fail_minor; |
1582 | } | 1582 | } |
1583 | ret = class_device_create_file(&vfd->class_dev, &class_device_attr_name); | 1583 | ret = class_device_create_file(&vfd->class_dev, &class_device_attr_name); |
1584 | if (ret < 0) { | 1584 | if (ret < 0) { |
1585 | printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret); | 1585 | printk(KERN_ERR "%s: class_device_create_file 'name' failed\n", |
1586 | return ret; | 1586 | __FUNCTION__); |
1587 | goto fail_classdev; | ||
1587 | } | 1588 | } |
1588 | 1589 | ||
1589 | #if 1 | 1590 | #if 1 |