diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-02-27 15:29:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 17:49:59 -0500 |
commit | 80b6ca48321974a6566a1c9048ba34f60420bca6 (patch) | |
tree | a350e3cf6b794081c13c89d5b1913b2c1207570d /drivers/usb/serial/io_ti.c | |
parent | d54a5cb6484705f7808b337917cc7598f2f971c3 (diff) |
[PATCH] USB: kzalloc() conversion for rest of drivers/usb
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/io_ti.c')
-rw-r--r-- | drivers/usb/serial/io_ti.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index afc0f34b3a46..8e1e2253748b 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -2727,12 +2727,11 @@ static int edge_startup (struct usb_serial *serial) | |||
2727 | dev = serial->dev; | 2727 | dev = serial->dev; |
2728 | 2728 | ||
2729 | /* create our private serial structure */ | 2729 | /* create our private serial structure */ |
2730 | edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); | 2730 | edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL); |
2731 | if (edge_serial == NULL) { | 2731 | if (edge_serial == NULL) { |
2732 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); | 2732 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); |
2733 | return -ENOMEM; | 2733 | return -ENOMEM; |
2734 | } | 2734 | } |
2735 | memset (edge_serial, 0, sizeof(struct edgeport_serial)); | ||
2736 | sema_init(&edge_serial->es_sem, 1); | 2735 | sema_init(&edge_serial->es_sem, 1); |
2737 | edge_serial->serial = serial; | 2736 | edge_serial->serial = serial; |
2738 | usb_set_serial_data(serial, edge_serial); | 2737 | usb_set_serial_data(serial, edge_serial); |
@@ -2745,12 +2744,11 @@ static int edge_startup (struct usb_serial *serial) | |||
2745 | 2744 | ||
2746 | /* set up our port private structures */ | 2745 | /* set up our port private structures */ |
2747 | for (i = 0; i < serial->num_ports; ++i) { | 2746 | for (i = 0; i < serial->num_ports; ++i) { |
2748 | edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); | 2747 | edge_port = kzalloc(sizeof(struct edgeport_port), GFP_KERNEL); |
2749 | if (edge_port == NULL) { | 2748 | if (edge_port == NULL) { |
2750 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); | 2749 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); |
2751 | goto cleanup; | 2750 | goto cleanup; |
2752 | } | 2751 | } |
2753 | memset (edge_port, 0, sizeof(struct edgeport_port)); | ||
2754 | spin_lock_init(&edge_port->ep_lock); | 2752 | spin_lock_init(&edge_port->ep_lock); |
2755 | edge_port->ep_out_buf = edge_buf_alloc(EDGE_OUT_BUF_SIZE); | 2753 | edge_port->ep_out_buf = edge_buf_alloc(EDGE_OUT_BUF_SIZE); |
2756 | if (edge_port->ep_out_buf == NULL) { | 2754 | if (edge_port->ep_out_buf == NULL) { |