FROMLIST: rpmsg: core: Introduce rproc_mem_entry_free

Introduce a helper to free the rproc_mem_entry allocated by
rproc_mem_entry_init(). This helper is to help manage rproc carveouts
added to an rproc outside of remoteproc.

Bug: 235577039
Link: https://lore.kernel.org/lkml/1654888985-3846-3-git-send-email-quic_clew@quicinc.com/
Change-Id: I70ea0e6455b9b050a73a73b0fb43fd7b67adb294
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
This commit is contained in:
Chris Lew 2022-06-08 13:55:00 -07:00 committed by Carlos Llamas
parent 9eed2acb93
commit 111cae8473
2 changed files with 14 additions and 0 deletions

View File

@ -1075,6 +1075,19 @@ rproc_mem_entry_init(struct device *dev,
}
EXPORT_SYMBOL(rproc_mem_entry_init);
/**
* rproc_mem_entry_free() - free a rproc_mem_entry struct
* @mem: rproc_mem_entry allocated by rproc_mem_entry_init()
*
* This function frees a rproc_mem_entry_struct that was allocated by
* rproc_mem_entry_init().
*/
void rproc_mem_entry_free(struct rproc_mem_entry *mem)
{
kfree(mem);
}
EXPORT_SYMBOL(rproc_mem_entry_free);
/**
* rproc_of_resm_mem_entry_init() - allocate and initialize rproc_mem_entry struct
* from a reserved memory phandle

View File

@ -664,6 +664,7 @@ rproc_mem_entry_init(struct device *dev,
int (*alloc)(struct rproc *, struct rproc_mem_entry *),
int (*release)(struct rproc *, struct rproc_mem_entry *),
const char *name, ...);
void rproc_mem_entry_free(struct rproc_mem_entry *mem);
struct rproc_mem_entry *
rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, size_t len,