diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2006-07-19 12:23:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-07-29 16:22:21 -0400 |
commit | 3117beec7e43f91ce156cacf033a712c7e22737d (patch) | |
tree | e661e3bbd6ebcd5537bfb7e526d8bbc55a3b0ebc /drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |
parent | d9cd2d9b61898354f5dbabdc490dd6ef309ebbd4 (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/pvrusb2/pvrusb2-sysfs.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 6af55a8b6f05..ef46d4f40cff 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |||
@@ -600,6 +600,8 @@ static ssize_t debugcmd_store(struct class_device *,const char *,size_t count); | |||
600 | static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) | 600 | static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) |
601 | { | 601 | { |
602 | struct pvr2_sysfs_debugifc *dip; | 602 | struct pvr2_sysfs_debugifc *dip; |
603 | int ret; | ||
604 | |||
603 | dip = kmalloc(sizeof(*dip),GFP_KERNEL); | 605 | dip = kmalloc(sizeof(*dip),GFP_KERNEL); |
604 | if (!dip) return; | 606 | if (!dip) return; |
605 | memset(dip,0,sizeof(*dip)); | 607 | memset(dip,0,sizeof(*dip)); |
@@ -613,8 +615,14 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) | |||
613 | dip->attr_debuginfo.attr.mode = S_IRUGO; | 615 | dip->attr_debuginfo.attr.mode = S_IRUGO; |
614 | dip->attr_debuginfo.show = debuginfo_show; | 616 | dip->attr_debuginfo.show = debuginfo_show; |
615 | sfp->debugifc = dip; | 617 | sfp->debugifc = dip; |
616 | class_device_create_file(sfp->class_dev,&dip->attr_debugcmd); | 618 | ret = class_device_create_file(sfp->class_dev,&dip->attr_debugcmd); |
617 | class_device_create_file(sfp->class_dev,&dip->attr_debuginfo); | 619 | if (ret < 0) |
620 | printk(KERN_WARNING "%s: class_device_create_file error: %d\n", | ||
621 | __FUNCTION__, ret); | ||
622 | ret = class_device_create_file(sfp->class_dev,&dip->attr_debuginfo); | ||
623 | if (ret < 0) | ||
624 | printk(KERN_WARNING "%s: class_device_create_file error: %d\n", | ||
625 | __FUNCTION__, ret); | ||
618 | } | 626 | } |
619 | 627 | ||
620 | 628 | ||
@@ -709,6 +717,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
709 | { | 717 | { |
710 | struct usb_device *usb_dev; | 718 | struct usb_device *usb_dev; |
711 | struct class_device *class_dev; | 719 | struct class_device *class_dev; |
720 | int ret; | ||
721 | |||
712 | usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); | 722 | usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); |
713 | if (!usb_dev) return; | 723 | if (!usb_dev) return; |
714 | class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL); | 724 | class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL); |
@@ -733,20 +743,33 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
733 | 743 | ||
734 | sfp->class_dev = class_dev; | 744 | sfp->class_dev = class_dev; |
735 | class_dev->class_data = sfp; | 745 | class_dev->class_data = sfp; |
736 | class_device_register(class_dev); | 746 | ret = class_device_register(class_dev); |
747 | if (ret) { | ||
748 | printk(KERN_ERR "%s: class_device_register failed\n", | ||
749 | __FUNCTION__); | ||
750 | kfree(class_dev); | ||
751 | return; | ||
752 | } | ||
737 | 753 | ||
738 | sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE; | 754 | sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE; |
739 | sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; | 755 | sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; |
740 | sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; | 756 | sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; |
741 | sfp->attr_v4l_minor_number.show = v4l_minor_number_show; | 757 | sfp->attr_v4l_minor_number.show = v4l_minor_number_show; |
742 | sfp->attr_v4l_minor_number.store = NULL; | 758 | sfp->attr_v4l_minor_number.store = NULL; |
743 | class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); | 759 | ret = class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); |
760 | if (ret < 0) | ||
761 | printk(KERN_WARNING "%s: class_device_create_file error: %d\n", | ||
762 | __FUNCTION__, ret); | ||
763 | |||
744 | sfp->attr_unit_number.attr.owner = THIS_MODULE; | 764 | sfp->attr_unit_number.attr.owner = THIS_MODULE; |
745 | sfp->attr_unit_number.attr.name = "unit_number"; | 765 | sfp->attr_unit_number.attr.name = "unit_number"; |
746 | sfp->attr_unit_number.attr.mode = S_IRUGO; | 766 | sfp->attr_unit_number.attr.mode = S_IRUGO; |
747 | sfp->attr_unit_number.show = unit_number_show; | 767 | sfp->attr_unit_number.show = unit_number_show; |
748 | sfp->attr_unit_number.store = NULL; | 768 | sfp->attr_unit_number.store = NULL; |
749 | class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); | 769 | ret = class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); |
770 | if (ret < 0) | ||
771 | printk(KERN_WARNING "%s: class_device_create_file error: %d\n", | ||
772 | __FUNCTION__, ret); | ||
750 | 773 | ||
751 | pvr2_sysfs_add_controls(sfp); | 774 | pvr2_sysfs_add_controls(sfp); |
752 | #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC | 775 | #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC |