forked from Minki/linux
staging: csr: remove CsrMemFree() and CsrMemFreeDma()
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>
This commit is contained in:
parent
d63123fc50
commit
4fe9db3710
@ -194,23 +194,6 @@ void *CsrMemAlloc(size_t size)
|
||||
}
|
||||
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
|
||||
@ -228,20 +211,3 @@ void *CsrMemAllocDma(size_t size)
|
||||
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);
|
||||
|
@ -283,19 +283,6 @@ void *CsrMemCallocDebug(size_t numberOfElements, size_t elementSize,
|
||||
void *CsrMemCalloc(size_t numberOfElements, size_t elementSize);
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*
|
||||
* NAME
|
||||
* CsrMemFree
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Free dynamic allocated memory.
|
||||
*
|
||||
* RETURNS
|
||||
* void
|
||||
*
|
||||
*----------------------------------------------------------------------------*/
|
||||
void CsrMemFree(void *pointer);
|
||||
|
||||
/*----------------------------------------------------------------------------*
|
||||
* NAME
|
||||
* CsrMemAllocDma
|
||||
@ -317,18 +304,6 @@ void *CsrMemAllocDma(size_t size);
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*
|
||||
* NAME
|
||||
* CsrMemFreeDma
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Free dynamic memory allocated by CsrMemAllocDma.
|
||||
*
|
||||
* RETURNS
|
||||
* void
|
||||
*
|
||||
*----------------------------------------------------------------------------*/
|
||||
void CsrMemFreeDma(void *pointer);
|
||||
#else
|
||||
|
||||
#include "csr_pmem.h"
|
||||
@ -337,12 +312,8 @@ void CsrMemFreeDma(void *pointer);
|
||||
|
||||
#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
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
#include <linux/slab.h>
|
||||
#include "csr_wifi_hip_unifi.h"
|
||||
#include "csr_wifi_hip_conversions.h"
|
||||
#include "csr_wifi_hip_unifiversion.h"
|
||||
@ -1793,37 +1794,22 @@ static void card_free_memory_resources(card_t *card)
|
||||
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;
|
||||
@ -1984,7 +1970,7 @@ void unifi_free_card(card_t *card)
|
||||
unifi_coredump_free(card); /* free anyway to prevent memory leak */
|
||||
}
|
||||
|
||||
CsrMemFree(card);
|
||||
kfree(card);
|
||||
|
||||
func_exit();
|
||||
} /* unifi_free_card() */
|
||||
|
@ -1817,7 +1817,7 @@ static CsrResult process_bulk_data_command(card_t *card, const u8 *cmdptr,
|
||||
/* 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
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
#include <linux/slab.h>
|
||||
#include "csr_wifi_hip_unifi.h"
|
||||
#include "csr_wifi_hip_unifiversion.h"
|
||||
#include "csr_wifi_hip_card.h"
|
||||
@ -270,7 +271,7 @@ static CsrResult do_patch_convert_download(card_t *card, void *dlpriv, xbv1_t *p
|
||||
/* 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)
|
||||
@ -347,7 +348,7 @@ CsrResult unifi_dl_firmware(card_t *card, void *dlpriv)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -372,7 +373,7 @@ CsrResult unifi_dl_firmware(card_t *card, void *dlpriv)
|
||||
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
|
||||
}
|
||||
|
||||
CsrMemFree(fwinfo);
|
||||
kfree(fwinfo);
|
||||
func_exit_r(r);
|
||||
return r;
|
||||
} /* unifi_dl_firmware() */
|
||||
@ -426,7 +427,7 @@ CsrResult unifi_dl_patch(card_t *card, void *dlpriv, u32 boot_ctrl)
|
||||
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;
|
||||
@ -441,7 +442,7 @@ CsrResult unifi_dl_patch(card_t *card, void *dlpriv, u32 boot_ctrl)
|
||||
{
|
||||
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;
|
||||
@ -458,7 +459,7 @@ CsrResult unifi_dl_patch(card_t *card, void *dlpriv, u32 boot_ctrl)
|
||||
unifi_error(card->ospriv, "Failed to patch image\n");
|
||||
}
|
||||
|
||||
CsrMemFree(fwinfo);
|
||||
kfree(fwinfo);
|
||||
|
||||
func_exit_r(r);
|
||||
return r;
|
||||
@ -720,7 +721,7 @@ static CsrResult send_ptdl_to_unifi(card_t *card, void *dlpriv,
|
||||
}
|
||||
}
|
||||
|
||||
CsrMemFreeDma(buf);
|
||||
kfree(buf);
|
||||
|
||||
if (r != CSR_RESULT_SUCCESS && r != CSR_WIFI_HIP_RESULT_NO_DEVICE)
|
||||
{
|
||||
|
@ -17,6 +17,7 @@
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
#include <linux/slab.h>
|
||||
#include "csr_wifi_hip_unifi.h"
|
||||
#include "csr_wifi_hip_unifiversion.h"
|
||||
#include "csr_wifi_hip_card.h"
|
||||
@ -696,7 +697,7 @@ coredump_buffer* new_coredump_node(void *ospriv, coredump_buffer *prevnode)
|
||||
{
|
||||
for (i = 0; newnode->zone[i] != NULL; i++)
|
||||
{
|
||||
CsrMemFree(newnode->zone[i]);
|
||||
kfree(newnode->zone[i]);
|
||||
newnode->zone[i] = NULL;
|
||||
}
|
||||
}
|
||||
@ -844,11 +845,8 @@ void unifi_coredump_free(card_t *card)
|
||||
/* 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 */
|
||||
@ -856,7 +854,7 @@ void unifi_coredump_free(card_t *card)
|
||||
node = node->next;
|
||||
|
||||
/* Free header */
|
||||
CsrMemFree(del_node);
|
||||
kfree(del_node);
|
||||
i++;
|
||||
} while ((node != NULL) && (node != card->dump_buf));
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
#include <linux/slab.h>
|
||||
|
||||
#ifdef CSR_WIFI_XBV_TEST
|
||||
/* Standalone test harness */
|
||||
@ -959,7 +960,7 @@ s32 xbv1_read_slut(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo
|
||||
*
|
||||
* 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
|
||||
@ -1021,7 +1022,7 @@ void* xbv_to_patch(card_t *card, fwreadfn_t readfn,
|
||||
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;
|
||||
}
|
||||
@ -1067,7 +1068,7 @@ void* xbv_to_patch(card_t *card, fwreadfn_t readfn,
|
||||
{
|
||||
*size = patch_offs;
|
||||
}
|
||||
CsrMemFree(rdbuf);
|
||||
kfree(rdbuf);
|
||||
|
||||
return patch_buf;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ static CsrResult signal_buffer_init(unifi_priv_t * priv, int size)
|
||||
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();
|
||||
@ -126,7 +126,7 @@ static void signal_buffer_free(unifi_priv_t * priv, int size)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user