aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/ioc4_serial.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2007-02-14 03:33:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 11:09:52 -0500
commit8f31bb39ec2a5622974666c72257e74c22492602 (patch)
tree48f38c994f02c8699fe2a69599e8cc1bc8d36ea8 /drivers/serial/ioc4_serial.c
parent3689a0ec60bc8f56cc372c1dfa0d89dab48f7c9c (diff)
[PATCH] serial: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/ioc4_serial.c')
-rw-r--r--drivers/serial/ioc4_serial.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index f540212e7409..0c179384fb0c 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -1076,13 +1076,12 @@ static int inline ioc4_attach_local(struct ioc4_driver_data *idd)
1076 /* Create port structures for each port */ 1076 /* Create port structures for each port */
1077 for (port_number = 0; port_number < IOC4_NUM_SERIAL_PORTS; 1077 for (port_number = 0; port_number < IOC4_NUM_SERIAL_PORTS;
1078 port_number++) { 1078 port_number++) {
1079 port = kmalloc(sizeof(struct ioc4_port), GFP_KERNEL); 1079 port = kzalloc(sizeof(struct ioc4_port), GFP_KERNEL);
1080 if (!port) { 1080 if (!port) {
1081 printk(KERN_WARNING 1081 printk(KERN_WARNING
1082 "IOC4 serial memory not available for port\n"); 1082 "IOC4 serial memory not available for port\n");
1083 return -ENOMEM; 1083 return -ENOMEM;
1084 } 1084 }
1085 memset(port, 0, sizeof(struct ioc4_port));
1086 spin_lock_init(&port->ip_lock); 1085 spin_lock_init(&port->ip_lock);
1087 1086
1088 /* we need to remember the previous ones, to point back to 1087 /* we need to remember the previous ones, to point back to
@@ -2811,7 +2810,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
2811 (void *)serial)); 2810 (void *)serial));
2812 2811
2813 /* Get memory for the new card */ 2812 /* Get memory for the new card */
2814 control = kmalloc(sizeof(struct ioc4_control), GFP_KERNEL); 2813 control = kzalloc(sizeof(struct ioc4_control), GFP_KERNEL);
2815 2814
2816 if (!control) { 2815 if (!control) {
2817 printk(KERN_WARNING "ioc4_attach_one" 2816 printk(KERN_WARNING "ioc4_attach_one"
@@ -2819,11 +2818,10 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
2819 ret = -ENOMEM; 2818 ret = -ENOMEM;
2820 goto out2; 2819 goto out2;
2821 } 2820 }
2822 memset(control, 0, sizeof(struct ioc4_control));
2823 idd->idd_serial_data = control; 2821 idd->idd_serial_data = control;
2824 2822
2825 /* Allocate the soft structure */ 2823 /* Allocate the soft structure */
2826 soft = kmalloc(sizeof(struct ioc4_soft), GFP_KERNEL); 2824 soft = kzalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
2827 if (!soft) { 2825 if (!soft) {
2828 printk(KERN_WARNING 2826 printk(KERN_WARNING
2829 "ioc4 (%p): unable to get memory for the soft struct\n", 2827 "ioc4 (%p): unable to get memory for the soft struct\n",
@@ -2831,7 +2829,6 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
2831 ret = -ENOMEM; 2829 ret = -ENOMEM;
2832 goto out3; 2830 goto out3;
2833 } 2831 }
2834 memset(soft, 0, sizeof(struct ioc4_soft));
2835 2832
2836 spin_lock_init(&soft->is_ir_lock); 2833 spin_lock_init(&soft->is_ir_lock);
2837 soft->is_ioc4_misc_addr = idd->idd_misc_regs; 2834 soft->is_ioc4_misc_addr = idd->idd_misc_regs;