diff options
author | Mike Isely <isely@pobox.com> | 2007-01-19 22:37:11 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:41 -0500 |
commit | ca545f7c39476c6c4c6e639452180a2b38342669 (patch) | |
tree | e9751274759bcdf51bff577f55a030d4f23dca90 /drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |
parent | eca8ebfc11d1935a7dd4c59cb8defb5bdff44ecd (diff) |
V4L/DVB (5091): Pvrusb2: Use kzalloc in place of kmalloc/memset pairs
Signed-off-by: Mike Isely <isely@pobox.com>
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 | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 2f6568e7e6f2..91396fd573e4 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |||
@@ -501,9 +501,8 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) | |||
501 | cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id); | 501 | cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id); |
502 | if (!cptr) return; | 502 | if (!cptr) return; |
503 | 503 | ||
504 | cip = kmalloc(sizeof(*cip),GFP_KERNEL); | 504 | cip = kzalloc(sizeof(*cip),GFP_KERNEL); |
505 | if (!cip) return; | 505 | if (!cip) return; |
506 | memset(cip,0,sizeof(*cip)); | ||
507 | pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); | 506 | pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); |
508 | 507 | ||
509 | cip->cptr = cptr; | 508 | cip->cptr = cptr; |
@@ -613,9 +612,8 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) | |||
613 | struct pvr2_sysfs_debugifc *dip; | 612 | struct pvr2_sysfs_debugifc *dip; |
614 | int ret; | 613 | int ret; |
615 | 614 | ||
616 | dip = kmalloc(sizeof(*dip),GFP_KERNEL); | 615 | dip = kzalloc(sizeof(*dip),GFP_KERNEL); |
617 | if (!dip) return; | 616 | if (!dip) return; |
618 | memset(dip,0,sizeof(*dip)); | ||
619 | dip->attr_debugcmd.attr.owner = THIS_MODULE; | 617 | dip->attr_debugcmd.attr.owner = THIS_MODULE; |
620 | dip->attr_debugcmd.attr.name = "debugcmd"; | 618 | dip->attr_debugcmd.attr.name = "debugcmd"; |
621 | dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; | 619 | dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; |
@@ -768,9 +766,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
768 | 766 | ||
769 | usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); | 767 | usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); |
770 | if (!usb_dev) return; | 768 | if (!usb_dev) return; |
771 | class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL); | 769 | class_dev = kzalloc(sizeof(*class_dev),GFP_KERNEL); |
772 | if (!class_dev) return; | 770 | if (!class_dev) return; |
773 | memset(class_dev,0,sizeof(*class_dev)); | ||
774 | 771 | ||
775 | pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); | 772 | pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); |
776 | 773 | ||
@@ -862,9 +859,8 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp, | |||
862 | struct pvr2_sysfs_class *class_ptr) | 859 | struct pvr2_sysfs_class *class_ptr) |
863 | { | 860 | { |
864 | struct pvr2_sysfs *sfp; | 861 | struct pvr2_sysfs *sfp; |
865 | sfp = kmalloc(sizeof(*sfp),GFP_KERNEL); | 862 | sfp = kzalloc(sizeof(*sfp),GFP_KERNEL); |
866 | if (!sfp) return sfp; | 863 | if (!sfp) return sfp; |
867 | memset(sfp,0,sizeof(*sfp)); | ||
868 | pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp); | 864 | pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp); |
869 | pvr2_channel_init(&sfp->channel,mp); | 865 | pvr2_channel_init(&sfp->channel,mp); |
870 | sfp->channel.check_func = pvr2_sysfs_internal_check; | 866 | sfp->channel.check_func = pvr2_sysfs_internal_check; |
@@ -885,9 +881,8 @@ static int pvr2_sysfs_hotplug(struct class_device *cd,char **envp, | |||
885 | struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) | 881 | struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) |
886 | { | 882 | { |
887 | struct pvr2_sysfs_class *clp; | 883 | struct pvr2_sysfs_class *clp; |
888 | clp = kmalloc(sizeof(*clp),GFP_KERNEL); | 884 | clp = kzalloc(sizeof(*clp),GFP_KERNEL); |
889 | if (!clp) return clp; | 885 | if (!clp) return clp; |
890 | memset(clp,0,sizeof(*clp)); | ||
891 | pvr2_sysfs_trace("Creating pvr2_sysfs_class id=%p",clp); | 886 | pvr2_sysfs_trace("Creating pvr2_sysfs_class id=%p",clp); |
892 | clp->class.name = "pvrusb2"; | 887 | clp->class.name = "pvrusb2"; |
893 | clp->class.class_release = pvr2_sysfs_class_release; | 888 | clp->class.class_release = pvr2_sysfs_class_release; |