summaryrefslogtreecommitdiff
path: root/drivers/serial/ioc4_serial.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2007-02-14 00:33:07 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 08:09:52 -0800
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)
/* Create port structures for each port */
for (port_number = 0; port_number < IOC4_NUM_SERIAL_PORTS;
port_number++) {
- port = kmalloc(sizeof(struct ioc4_port), GFP_KERNEL);
+ port = kzalloc(sizeof(struct ioc4_port), GFP_KERNEL);
if (!port) {
printk(KERN_WARNING
"IOC4 serial memory not available for port\n");
return -ENOMEM;
}
- memset(port, 0, sizeof(struct ioc4_port));
spin_lock_init(&port->ip_lock);
/* we need to remember the previous ones, to point back to
@@ -2811,7 +2810,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
(void *)serial));
/* Get memory for the new card */
- control = kmalloc(sizeof(struct ioc4_control), GFP_KERNEL);
+ control = kzalloc(sizeof(struct ioc4_control), GFP_KERNEL);
if (!control) {
printk(KERN_WARNING "ioc4_attach_one"
@@ -2819,11 +2818,10 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
ret = -ENOMEM;
goto out2;
}
- memset(control, 0, sizeof(struct ioc4_control));
idd->idd_serial_data = control;
/* Allocate the soft structure */
- soft = kmalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
+ soft = kzalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
if (!soft) {
printk(KERN_WARNING
"ioc4 (%p): unable to get memory for the soft struct\n",
@@ -2831,7 +2829,6 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
ret = -ENOMEM;
goto out3;
}
- memset(soft, 0, sizeof(struct ioc4_soft));
spin_lock_init(&soft->is_ir_lock);
soft->is_ioc4_misc_addr = idd->idd_misc_regs;