summaryrefslogtreecommitdiff
path: root/drivers/staging/csr/csr_wifi_hip_card_sdio.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 22:37:12 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 22:37:12 (GMT)
commit70128792b7802efcf485e9b62249cf8a639187d8 (patch)
tree22453e906c9796628b84256944786db506450cf3 /drivers/staging/csr/csr_wifi_hip_card_sdio.c
parent4fe9db37104f833972486355fe86d7dcd29279b5 (diff)
downloadlinux-fsl-qoriq-70128792b7802efcf485e9b62249cf8a639187d8.tar.xz
staging: csr: remove CsrMemAlloc()
It's just calling kmalloc(, GFP_KERNEL), so call that instead. A few places should be calling kzalloc(), so do that, and remove the call to memset at the same time. Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/csr/csr_wifi_hip_card_sdio.c')
-rw-r--r--drivers/staging/csr/csr_wifi_hip_card_sdio.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/staging/csr/csr_wifi_hip_card_sdio.c b/drivers/staging/csr/csr_wifi_hip_card_sdio.c
index 4f2d2e3..608a069 100644
--- a/drivers/staging/csr/csr_wifi_hip_card_sdio.c
+++ b/drivers/staging/csr/csr_wifi_hip_card_sdio.c
@@ -73,13 +73,11 @@ card_t* unifi_alloc_card(CsrSdioFunction *sdio, void *ospriv)
func_enter();
- card = (card_t *)CsrMemAlloc(sizeof(card_t));
+ card = kzalloc(sizeof(card_t), GFP_KERNEL);
if (card == NULL)
{
return NULL;
}
- memset(card, 0, sizeof(card_t));
-
card->sdio_if = sdio;
card->ospriv = ospriv;
@@ -1665,8 +1663,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
n = cfg_data->num_fromhost_data_slots;
unifi_trace(card->ospriv, UDBG3, "Alloc from-host resources, %d slots.\n", n);
- card->from_host_data =
- (slot_desc_t *)CsrMemAlloc(n * sizeof(slot_desc_t));
+ card->from_host_data = kmalloc(n * sizeof(slot_desc_t), GFP_KERNEL);
if (card->from_host_data == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for F-H bulk data array\n");
@@ -1681,8 +1678,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
}
/* Allocate memory for the array used for slot host tag mapping */
- card->fh_slot_host_tag_record =
- (u32 *)CsrMemAlloc(n * sizeof(u32));
+ card->fh_slot_host_tag_record = kmalloc(n * sizeof(u32), GFP_KERNEL);
if (card->fh_slot_host_tag_record == NULL)
{
@@ -1702,8 +1698,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
n = cfg_data->num_tohost_data_slots;
unifi_trace(card->ospriv, UDBG3, "Alloc to-host resources, %d slots.\n", n);
- card->to_host_data =
- (bulk_data_desc_t *)CsrMemAlloc(n * sizeof(bulk_data_desc_t));
+ card->to_host_data = kmalloc(n * sizeof(bulk_data_desc_t), GFP_KERNEL);
if (card->to_host_data == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for T-H bulk data array\n");