They were just wrappers around kfree() so call that instead.
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>
}
EXPORT_SYMBOL_GPL(CsrMemAlloc);
-/*----------------------------------------------------------------------------*
- * NAME
- * CsrMemFree
- *
- * DESCRIPTION
- * Free dynamic allocated memory.
- *
- * RETURNS
- * void
- *
- *----------------------------------------------------------------------------*/
-void CsrMemFree(void *pointer)
-{
- kfree(pointer);
-}
-EXPORT_SYMBOL_GPL(CsrMemFree);
-
/*----------------------------------------------------------------------------*
* NAME
* CsrMemAllocDma
return kmalloc(size, GFP_KERNEL | GFP_DMA);
}
EXPORT_SYMBOL_GPL(CsrMemAllocDma);
-
-/*----------------------------------------------------------------------------*
- * NAME
- * CsrMemFreeDma
- *
- * DESCRIPTION
- * Free DMA capable dynamic allocated memory.
- *
- * RETURNS
- * void
- *
- *----------------------------------------------------------------------------*/
-void CsrMemFreeDma(void *pointer)
-{
- kfree(pointer);
-}
-EXPORT_SYMBOL_GPL(CsrMemFreeDma);
void *CsrMemCalloc(size_t numberOfElements, size_t elementSize);
#endif
-/*----------------------------------------------------------------------------*
- * NAME
- * CsrMemFree
- *
- * DESCRIPTION
- * Free dynamic allocated memory.
- *
- * RETURNS
- * void
- *
- *----------------------------------------------------------------------------*/
-void CsrMemFree(void *pointer);
-
/*----------------------------------------------------------------------------*
* NAME
* CsrMemAllocDma
#endif
-/*----------------------------------------------------------------------------*
- * NAME
- * CsrMemFreeDma
- *
- * DESCRIPTION
- * Free dynamic memory allocated by CsrMemAllocDma.
- *
- * RETURNS
- * void
- *
- *----------------------------------------------------------------------------*/
-void CsrMemFreeDma(void *pointer);
#else
#include "csr_pmem.h"
#define CsrMemCalloc(numberOfElements, elementSize) CsrPmemDebugAlloc((numberOfElements * elementSize), CSR_PMEM_DEBUG_TYPE_MEM_CALLOC, __FILE__, __LINE__)
-#define CsrMemFree(ptr) CsrPmemDebugFree(ptr,CSR_PMEM_DEBUG_TYPE_MEM_ALLOC, __FILE__, __LINE__)
-
#define CsrMemAllocDma(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_MEM_ALLOC_DMA, __FILE__, __LINE__)
-#define CsrMemFreeDma(ptr) CsrPmemDebugFree(ptr, CSR_PMEM_DEBUG_TYPE_MEM_ALLOC_DMA, __FILE__, __LINE__)
-
#endif
*
* ---------------------------------------------------------------------------
*/
+#include <linux/slab.h>
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_conversions.h"
#include "csr_wifi_hip_unifiversion.h"
unifi_cancel_pending_signals(card);
- if (card->to_host_data)
- {
- CsrMemFree(card->to_host_data);
- card->to_host_data = NULL;
- }
+ kfree(card->to_host_data);
+ card->to_host_data = NULL;
- if (card->from_host_data)
- {
- CsrMemFree(card->from_host_data);
- card->from_host_data = NULL;
- }
+ kfree(card->from_host_data);
+ card->from_host_data = NULL;
/* free the memory for slot host tag mapping array */
- if (card->fh_slot_host_tag_record)
- {
- CsrMemFree(card->fh_slot_host_tag_record);
- card->fh_slot_host_tag_record = NULL;
- }
+ kfree(card->fh_slot_host_tag_record);
+ card->fh_slot_host_tag_record = NULL;
- if (card->fh_buffer.buf)
- {
- CsrMemFreeDma(card->fh_buffer.buf);
- }
+ kfree(card->fh_buffer.buf);
card->fh_buffer.ptr = card->fh_buffer.buf = NULL;
card->fh_buffer.bufsize = 0;
card->fh_buffer.count = 0;
- if (card->th_buffer.buf)
- {
- CsrMemFreeDma(card->th_buffer.buf);
- }
+ kfree(card->th_buffer.buf);
card->th_buffer.ptr = card->th_buffer.buf = NULL;
card->th_buffer.bufsize = 0;
card->th_buffer.count = 0;
unifi_coredump_free(card); /* free anyway to prevent memory leak */
}
- CsrMemFree(card);
+ kfree(card);
func_exit();
} /* unifi_free_card() */
/* moving this check before we clear host data slot */
if ((len != 0) && (dir == UNIFI_SDIO_WRITE) && (((ptrdiff_t)bdslot->os_data_ptr + offset) & 3))
{
- CsrMemFreeDma(host_bulk_data_slot);
+ kfree(host_bulk_data_slot);
}
#endif
*
* ---------------------------------------------------------------------------
*/
+#include <linux/slab.h>
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_unifiversion.h"
#include "csr_wifi_hip_card.h"
/* Download the patch */
unifi_info(card->ospriv, "Downloading converted f/w as patch\n");
r = unifi_dl_patch(card, desc, sym.obj);
- CsrMemFree(pfw);
+ kfree(pfw);
unifi_fw_close_buffer(card->ospriv, desc);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "File type is %s, expected firmware.\n",
fwinfo->mode == xbv_patch?"patch" : "unknown");
- CsrMemFree(fwinfo);
+ kfree(fwinfo);
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
- CsrMemFree(fwinfo);
+ kfree(fwinfo);
func_exit_r(r);
return r;
} /* unifi_dl_firmware() */
r = xbv1_parse(card, unifi_fw_read, dlpriv, fwinfo);
if (r != CSR_RESULT_SUCCESS || fwinfo->mode != xbv_patch)
{
- CsrMemFree(fwinfo);
+ kfree(fwinfo);
unifi_error(card->ospriv, "Failed to read in patch file\n");
func_exit();
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
{
unifi_error(card->ospriv, "Wrong patch file for chip (chip = %lu, file = %lu)\n",
card->build_id, fwinfo->build_id);
- CsrMemFree(fwinfo);
+ kfree(fwinfo);
#ifndef CSR_WIFI_IGNORE_PATCH_VERSION_MISMATCH
func_exit();
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
unifi_error(card->ospriv, "Failed to patch image\n");
}
- CsrMemFree(fwinfo);
+ kfree(fwinfo);
func_exit_r(r);
return r;
}
}
- CsrMemFreeDma(buf);
+ kfree(buf);
if (r != CSR_RESULT_SUCCESS && r != CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
*
* ---------------------------------------------------------------------------
*/
+#include <linux/slab.h>
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_unifiversion.h"
#include "csr_wifi_hip_card.h"
{
for (i = 0; newnode->zone[i] != NULL; i++)
{
- CsrMemFree(newnode->zone[i]);
+ kfree(newnode->zone[i]);
newnode->zone[i] = NULL;
}
}
/* Free payload zones */
for (j = 0; j < HIP_CDUMP_NUM_ZONES; j++)
{
- if (node->zone[j] != NULL)
- {
- CsrMemFree(node->zone[j]);
- node->zone[j] = NULL;
- }
+ kfree(node->zone[j]);
+ node->zone[j] = NULL;
}
/* Detach */
node = node->next;
/* Free header */
- CsrMemFree(del_node);
+ kfree(del_node);
i++;
} while ((node != NULL) && (node != card->dump_buf));
*
* ---------------------------------------------------------------------------
*/
+#include <linux/slab.h>
#ifdef CSR_WIFI_XBV_TEST
/* Standalone test harness */
*
* Returns:
* Pointer to firmware image, or NULL on error. Caller must free this
- * buffer via CsrMemFree() once it's finished with.
+ * buffer via kfree() once it's finished with.
*
* Notes:
* The input fw_buf should have been checked via xbv1_parse prior to
patch_buf = (void *)CsrMemAlloc(patch_buf_size);
if (!patch_buf)
{
- CsrMemFree(rdbuf);
+ kfree(rdbuf);
unifi_error(NULL, "Can't malloc buffer for patch conversion\n");
return NULL;
}
{
*size = patch_offs;
}
- CsrMemFree(rdbuf);
+ kfree(rdbuf);
return patch_buf;
}
for(j=0;j<i;j++)
{
priv->rxSignalBuffer.rx_buff[j].sig_len=0;
- CsrMemFree(priv->rxSignalBuffer.rx_buff[j].bufptr);
+ kfree(priv->rxSignalBuffer.rx_buff[j].bufptr);
priv->rxSignalBuffer.rx_buff[j].bufptr = NULL;
}
func_exit();
for(i=0; i<size; i++)
{
priv->rxSignalBuffer.rx_buff[i].sig_len=0;
- CsrMemFree(priv->rxSignalBuffer.rx_buff[i].bufptr);
+ kfree(priv->rxSignalBuffer.rx_buff[i].bufptr);
priv->rxSignalBuffer.rx_buff[i].bufptr = NULL;
}
}