aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videodev.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2006-07-19 12:23:38 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-07-29 16:22:21 -0400
commit3117beec7e43f91ce156cacf033a712c7e22737d (patch)
treee661e3bbd6ebcd5537bfb7e526d8bbc55a3b0ebc /drivers/media/video/videodev.c
parentd9cd2d9b61898354f5dbabdc490dd6ef309ebbd4 (diff)
V4L/DVB (4316): Check __must_check warnings
Check __must_check warnings for class_device_register and class_device_create_file video_device_create_file was declared as a void, but instead should return the int value of class_device_create_file. Move the check from bttv-driver.c into v4l2-dev.h, because all other callers of video_device_create_file must also be checked. Replace the call to class_device_create_file in videodev.c with video_device_create_file, as defined in v4l2-dev.h, so that the return value of class_device_create_file will be checked. Check the return value of class_device_register in videodev.c and pvrusb2-sysfs.c Signed-off-by: Michael Krufky <mkrufky@linuxtv.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.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index b26ebaff226f..4c3f92605a82 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -1512,6 +1512,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
1512 int i=0; 1512 int i=0;
1513 int base; 1513 int base;
1514 int end; 1514 int end;
1515 int ret;
1515 char *name_base; 1516 char *name_base;
1516 1517
1517 switch(type) 1518 switch(type)
@@ -1571,9 +1572,13 @@ int video_register_device(struct video_device *vfd, int type, int nr)
1571 vfd->class_dev.class = &video_class; 1572 vfd->class_dev.class = &video_class;
1572 vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); 1573 vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
1573 sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base); 1574 sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base);
1574 class_device_register(&vfd->class_dev); 1575 ret = class_device_register(&vfd->class_dev);
1575 class_device_create_file(&vfd->class_dev, 1576 if (ret) {
1576 &class_device_attr_name); 1577 printk(KERN_ERR "%s: class_device_register failed\n",
1578 __FUNCTION__);
1579 return ret;
1580 }
1581 video_device_create_file(vfd, &class_device_attr_name);
1577 1582
1578#if 1 1583#if 1
1579 /* needed until all drivers are fixed */ 1584 /* needed until all drivers are fixed */