atomisp: kill off mmgr_free

This is just another wrapper layer around hmm_free that servers no purpose
in this driver.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alan Cox 2017-04-28 13:09:46 +01:00 committed by Greg Kroah-Hartman
parent b83cc378df
commit f5a6ddaad4
14 changed files with 30 additions and 49 deletions

View File

@ -136,7 +136,7 @@ void atomisp_acc_release(struct atomisp_sub_device *asd)
/* Free all mapped memory blocks */
list_for_each_entry_safe(atomisp_map, tm, &asd->acc.memory_maps, list) {
list_del(&atomisp_map->list);
mmgr_free(atomisp_map->ptr);
hmm_free(atomisp_map->ptr);
kfree(atomisp_map);
}
}
@ -374,7 +374,7 @@ int atomisp_acc_map(struct atomisp_sub_device *asd, struct atomisp_acc_map *map)
atomisp_map = kmalloc(sizeof(*atomisp_map), GFP_KERNEL);
if (!atomisp_map) {
mmgr_free(cssptr);
hmm_free(cssptr);
return -ENOMEM;
}
atomisp_map->ptr = cssptr;
@ -399,7 +399,7 @@ int atomisp_acc_unmap(struct atomisp_sub_device *asd, struct atomisp_acc_map *ma
return -EINVAL;
list_del(&atomisp_map->list);
mmgr_free(atomisp_map->ptr);
hmm_free(atomisp_map->ptr);
kfree(atomisp_map);
return 0;
}

View File

@ -108,7 +108,7 @@ void ia_css_refcount_uninit(void)
/* ia_css_debug_dtrace(IA_CSS_DBG_TRACE,
"ia_css_refcount_uninit: freeing (%x)\n",
entry->data);*/
mmgr_free(entry->data);
hmm_free(entry->data);
entry->data = mmgr_NULL;
entry->count = 0;
entry->id = 0;
@ -181,7 +181,7 @@ bool ia_css_refcount_decrement(int32_t id, hrt_vaddress ptr)
if (entry->count == 0) {
/* ia_css_debug_dtrace(IA_CSS_DBEUG_TRACE,
"ia_css_refcount_decrement: freeing\n");*/
mmgr_free(ptr);
hmm_free(ptr);
entry->data = mmgr_NULL;
entry->id = 0;
}
@ -244,9 +244,9 @@ void ia_css_refcount_clear(int32_t id, clear_func clear_func_ptr)
} else {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_refcount_clear: "
"using mmgr_free: "
"using hmm_free: "
"no clear_func\n");
mmgr_free(entry->data);
hmm_free(entry->data);
}
#ifndef ISP2401

View File

@ -59,6 +59,8 @@
*/
#include "device_access.h"
#include "hmm/hmm.h"
/*!
* \brief
* Bit masks for specialised allocation functions
@ -106,14 +108,6 @@ extern hrt_vaddress mmgr_malloc(const size_t size);
*/
extern hrt_vaddress mmgr_calloc(const size_t N, const size_t size);
/*! Free the memory allocation identified by the address
\param vaddr[in] Address of the allocation
\return vaddress
*/
extern void mmgr_free(hrt_vaddress vaddr);
/*! Return the address of an allocation in memory
\param size[in] Size in bytes of the allocation

View File

@ -52,12 +52,6 @@ mmgr_calloc(const size_t N, const size_t size)
return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED);
}
void
mmgr_free(hrt_vaddress vaddr)
{
hmm_free(vaddr);
}
void
mmgr_clear(hrt_vaddress vaddr, const size_t size)
{

View File

@ -390,7 +390,7 @@ void
ia_css_isp_dvs_statistics_free(struct ia_css_isp_dvs_statistics *me)
{
if (me != NULL) {
mmgr_free(me->data_ptr);
hmm_free(me->data_ptr);
sh_css_free(me);
}
}

View File

@ -304,7 +304,7 @@ void
ia_css_isp_dvs2_statistics_free(struct ia_css_isp_dvs_statistics *me)
{
if (me != NULL) {
mmgr_free(me->data_ptr);
hmm_free(me->data_ptr);
sh_css_free(me);
}
}

View File

@ -990,7 +990,7 @@ ia_css_binary_uninit(void)
for (i = 0; i < IA_CSS_BINARY_NUM_MODES; i++) {
for (b = binary_infos[i]; b; b = b->next) {
if (b->xmem_addr)
mmgr_free(b->xmem_addr);
hmm_free(b->xmem_addr);
b->xmem_addr = mmgr_NULL;
}
binary_infos[i] = NULL;

View File

@ -345,7 +345,7 @@ void ia_css_frame_free(struct ia_css_frame *frame)
IA_CSS_ENTER_PRIVATE("frame = %p", frame);
if (frame != NULL) {
mmgr_free(frame->data);
hmm_free(frame->data);
sh_css_free(frame);
}

View File

@ -167,7 +167,7 @@ ia_css_isp_param_destroy_isp_parameters(
if (mem_params->params[pclass][mem].address)
sh_css_free(mem_params->params[pclass][mem].address);
if (css_params->params[pclass][mem].address)
mmgr_free(css_params->params[pclass][mem].address);
hmm_free(css_params->params[pclass][mem].address);
mem_params->params[pclass][mem].address = NULL;
css_params->params[pclass][mem].address = 0x0;
}

View File

@ -17,7 +17,7 @@
#include <type_support.h>
#include <assert_support.h>
#include <platform_support.h> /* memset */
#include <memory_access.h> /* mmmgr_malloc, mmmgr_free */
#include <memory_access.h> /* mmmgr_malloc, mhmm_free */
#include <ia_css_debug.h>
/**
@ -185,7 +185,7 @@ void ia_css_rmgr_uninit_vbuf(struct ia_css_rmgr_vbuf_pool *pool)
pool->handles[i]->vptr,
pool->handles[i]->count);
/* free memory */
mmgr_free(pool->handles[i]->vptr);
hmm_free(pool->handles[i]->vptr);
/* remove from refcount admin */
ia_css_rmgr_refcount_release_vbuf(
&pool->handles[i]);
@ -319,7 +319,7 @@ void ia_css_rmgr_rel_vbuf(struct ia_css_rmgr_vbuf_pool *pool,
if ((*handle)->count == 1) {
if (!pool->recycle) {
/* non recycling pool, free mem */
mmgr_free((*handle)->vptr);
hmm_free((*handle)->vptr);
} else {
/* recycle to pool */
rmgr_push_handle(pool, handle);

View File

@ -91,7 +91,7 @@ enum ia_css_err ia_css_spctrl_load_fw(sp_ID_t sp_id,
if (sizeof(hrt_vaddress) > sizeof(hrt_data)) {
ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
"size of hrt_vaddress can not be greater than hrt_data\n");
mmgr_free(code_addr);
hmm_free(code_addr);
code_addr = mmgr_NULL;
return IA_CSS_ERR_INTERNAL_ERROR;
}
@ -100,7 +100,7 @@ enum ia_css_err ia_css_spctrl_load_fw(sp_ID_t sp_id,
if ((init_dmem_cfg->ddr_data_addr % HIVE_ISP_DDR_WORD_BYTES) != 0) {
ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
"DDR address pointer is not properly aligned for DMA transfer\n");
mmgr_free(code_addr);
hmm_free(code_addr);
code_addr = mmgr_NULL;
return IA_CSS_ERR_INTERNAL_ERROR;
}
@ -143,7 +143,7 @@ enum ia_css_err ia_css_spctrl_unload_fw(sp_ID_t sp_id)
/* freeup the resource */
if (spctrl_cofig_info[sp_id].code_addr)
mmgr_free(spctrl_cofig_info[sp_id].code_addr);
hmm_free(spctrl_cofig_info[sp_id].code_addr);
spctrl_loaded[sp_id] = false;
return IA_CSS_SUCCESS;
}

View File

@ -2613,7 +2613,7 @@ ia_css_pipe_destroy(struct ia_css_pipe *pipe)
#ifndef ISP2401
if (pipe->scaler_pp_lut != mmgr_NULL) {
mmgr_free(pipe->scaler_pp_lut);
hmm_free(pipe->scaler_pp_lut);
pipe->scaler_pp_lut = mmgr_NULL;
}
#else
@ -8692,7 +8692,7 @@ acc_unload_extension(struct ia_css_fw_info *firmware)
while (hd){
hdn = (hd->next) ? &(*hd->next) : NULL;
if (hd->info.isp.xmem_addr) {
mmgr_free(hd->info.isp.xmem_addr);
hmm_free(hd->info.isp.xmem_addr);
hd->info.isp.xmem_addr = mmgr_NULL;
}
hd->isp_code = NULL;

View File

@ -2825,7 +2825,7 @@ void
ia_css_isp_3a_statistics_free(struct ia_css_isp_3a_statistics *me)
{
if (me != NULL) {
mmgr_free(me->data_ptr);
hmm_free(me->data_ptr);
sh_css_free(me);
}
}
@ -2874,7 +2874,7 @@ ia_css_metadata_free(struct ia_css_metadata *me)
* We found this to be confusing during development
* and debugging. */
IA_CSS_ENTER("me=%p", me);
mmgr_free(me->address);
hmm_free(me->address);
sh_css_free(me);
IA_CSS_LEAVE("void");
}
@ -3320,7 +3320,7 @@ inline hrt_vaddress sh_css_params_alloc_gdc_lut(void)
inline void sh_css_params_free_gdc_lut(hrt_vaddress addr)
{
if (addr != mmgr_NULL)
mmgr_free(addr);
hmm_free(addr);
}
enum ia_css_err ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
@ -3358,7 +3358,7 @@ enum ia_css_err ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
/* Free any existing tables. */
#ifndef ISP2401
if (pipe->scaler_pp_lut != mmgr_NULL) {
mmgr_free(pipe->scaler_pp_lut);
hmm_free(pipe->scaler_pp_lut);
pipe->scaler_pp_lut = mmgr_NULL;
}
#else
@ -3447,7 +3447,7 @@ void sh_css_params_free_default_gdc_lut(void)
#ifndef ISP2401
if (default_gdc_lut != mmgr_NULL) {
mmgr_free(default_gdc_lut);
hmm_free(default_gdc_lut);
default_gdc_lut = mmgr_NULL;
}
#else
@ -3479,7 +3479,7 @@ static void free_buffer_callback(
{
IA_CSS_ENTER_PRIVATE("void");
mmgr_free(ptr);
hmm_free(ptr);
IA_CSS_LEAVE_PRIVATE("void");
}
@ -3495,8 +3495,8 @@ sh_css_param_clear_param_sets(void)
}
/*
* MW: we can define mmgr_free() to return a NULL
* then you can write ptr = mmgr_free(ptr);
* MW: we can define hmm_free() to return a NULL
* then you can write ptr = hmm_free(ptr);
*/
#define safe_free(id, x) \
do { \

View File

@ -45,13 +45,6 @@ ia_css_ptr mmgr_calloc(const size_t N, const size_t size)
MMGR_ATTRIBUTE_CLEARED|MMGR_ATTRIBUTE_CACHED);
}
void mmgr_free(ia_css_ptr vaddr)
{
/* "free()" should accept NULL, "hmm_free()" may not */
if (vaddr)
hmm_free(vaddr);
}
ia_css_ptr mmgr_alloc_attr(const size_t size, const uint16_t attribute)
{
ia_css_ptr ptr;