aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-02-27 15:29:43 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:59 -0500
commit80b6ca48321974a6566a1c9048ba34f60420bca6 (patch)
treea350e3cf6b794081c13c89d5b1913b2c1207570d /drivers/usb/host
parentd54a5cb6484705f7808b337917cc7598f2f971c3 (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/host')
-rw-r--r--drivers/usb/host/ehci-mem.c10
-rw-r--r--drivers/usb/host/ehci-sched.c3
-rw-r--r--drivers/usb/host/hc_crisv10.c12
3 files changed, 8 insertions, 17 deletions
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index ec7eb3f4f867..766061e0260a 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -220,13 +220,9 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
220 ehci->periodic [i] = EHCI_LIST_END; 220 ehci->periodic [i] = EHCI_LIST_END;
221 221
222 /* software shadow of hardware table */ 222 /* software shadow of hardware table */
223 ehci->pshadow = kmalloc (ehci->periodic_size * sizeof (void *), flags); 223 ehci->pshadow = kcalloc(ehci->periodic_size, sizeof(void *), flags);
224 if (ehci->pshadow == NULL) { 224 if (ehci->pshadow != NULL)
225 goto fail; 225 return 0;
226 }
227 memset (ehci->pshadow, 0, ehci->periodic_size * sizeof (void *));
228
229 return 0;
230 226
231fail: 227fail:
232 ehci_dbg (ehci, "couldn't init memory\n"); 228 ehci_dbg (ehci, "couldn't init memory\n");
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 90d6900a37f4..5871944e6145 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -864,9 +864,8 @@ iso_sched_alloc (unsigned packets, gfp_t mem_flags)
864 int size = sizeof *iso_sched; 864 int size = sizeof *iso_sched;
865 865
866 size += packets * sizeof (struct ehci_iso_packet); 866 size += packets * sizeof (struct ehci_iso_packet);
867 iso_sched = kmalloc (size, mem_flags); 867 iso_sched = kzalloc(size, mem_flags);
868 if (likely (iso_sched != NULL)) { 868 if (likely (iso_sched != NULL)) {
869 memset(iso_sched, 0, size);
870 INIT_LIST_HEAD (&iso_sched->td_list); 869 INIT_LIST_HEAD (&iso_sched->td_list);
871 } 870 }
872 return iso_sched; 871 return iso_sched;
diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c
index 641268d7e6f3..2fe7fd19437b 100644
--- a/drivers/usb/host/hc_crisv10.c
+++ b/drivers/usb/host/hc_crisv10.c
@@ -2137,10 +2137,9 @@ static int etrax_usb_submit_bulk_urb(struct urb *urb)
2137 urb->status = -EINPROGRESS; 2137 urb->status = -EINPROGRESS;
2138 2138
2139 /* Setup the hcpriv data. */ 2139 /* Setup the hcpriv data. */
2140 urb_priv = kmalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG); 2140 urb_priv = kzalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
2141 assert(urb_priv != NULL); 2141 assert(urb_priv != NULL);
2142 /* This sets rx_offset to 0. */ 2142 /* This sets rx_offset to 0. */
2143 memset(urb_priv, 0, sizeof(etrax_urb_priv_t));
2144 urb_priv->urb_state = NOT_STARTED; 2143 urb_priv->urb_state = NOT_STARTED;
2145 urb->hcpriv = urb_priv; 2144 urb->hcpriv = urb_priv;
2146 2145
@@ -2475,10 +2474,9 @@ static int etrax_usb_submit_ctrl_urb(struct urb *urb)
2475 urb->status = -EINPROGRESS; 2474 urb->status = -EINPROGRESS;
2476 2475
2477 /* Setup the hcpriv data. */ 2476 /* Setup the hcpriv data. */
2478 urb_priv = kmalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG); 2477 urb_priv = kzalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
2479 assert(urb_priv != NULL); 2478 assert(urb_priv != NULL);
2480 /* This sets rx_offset to 0. */ 2479 /* This sets rx_offset to 0. */
2481 memset(urb_priv, 0, sizeof(etrax_urb_priv_t));
2482 urb_priv->urb_state = NOT_STARTED; 2480 urb_priv->urb_state = NOT_STARTED;
2483 urb->hcpriv = urb_priv; 2481 urb->hcpriv = urb_priv;
2484 2482
@@ -2767,9 +2765,8 @@ static void etrax_usb_add_to_intr_sb_list(struct urb *urb, int epid)
2767 maxlen = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe)); 2765 maxlen = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe));
2768 interval = urb->interval; 2766 interval = urb->interval;
2769 2767
2770 urb_priv = kmalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG); 2768 urb_priv = kzalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
2771 assert(urb_priv != NULL); 2769 assert(urb_priv != NULL);
2772 memset(urb_priv, 0, sizeof(etrax_urb_priv_t));
2773 urb->hcpriv = urb_priv; 2770 urb->hcpriv = urb_priv;
2774 2771
2775 first_ep = &TxIntrEPList[0]; 2772 first_ep = &TxIntrEPList[0];
@@ -2997,9 +2994,8 @@ static void etrax_usb_add_to_isoc_sb_list(struct urb *urb, int epid)
2997 2994
2998 prev_sb_desc = next_sb_desc = temp_sb_desc = NULL; 2995 prev_sb_desc = next_sb_desc = temp_sb_desc = NULL;
2999 2996
3000 urb_priv = kmalloc(sizeof(etrax_urb_priv_t), GFP_ATOMIC); 2997 urb_priv = kzalloc(sizeof(etrax_urb_priv_t), GFP_ATOMIC);
3001 assert(urb_priv != NULL); 2998 assert(urb_priv != NULL);
3002 memset(urb_priv, 0, sizeof(etrax_urb_priv_t));
3003 2999
3004 urb->hcpriv = urb_priv; 3000 urb->hcpriv = urb_priv;
3005 urb_priv->epid = epid; 3001 urb_priv->epid = epid;