FROMLIST: remoteproc: core: Add helper to remove carveouts
To mirror the exported rproc_add_carveout(), add a rproc_del_carveout() so carveout lifetime can be managed more accurately. Bug: 235577039 Link: https://lore.kernel.org/lkml/1654888985-3846-2-git-send-email-quic_clew@quicinc.com/ Change-Id: Ia562829f26a007aef3101f2e51f87b30b43addf7 Signed-off-by: Chris Lew <quic_clew@quicinc.com>
This commit is contained in:
parent
6ac966ab47
commit
9eed2acb93
|
@ -1007,6 +1007,26 @@ void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem)
|
|||
}
|
||||
EXPORT_SYMBOL(rproc_add_carveout);
|
||||
|
||||
/**
|
||||
* rproc_del_carveout() - remove an allocated carveout region
|
||||
* @rproc: rproc handle
|
||||
* @mem: memory entry to register
|
||||
*
|
||||
* This function removes specified memory entry in @rproc carveouts list.
|
||||
*/
|
||||
void rproc_del_carveout(struct rproc *rproc, struct rproc_mem_entry *mem)
|
||||
{
|
||||
struct rproc_mem_entry *entry, *tmp;
|
||||
|
||||
list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) {
|
||||
if (entry == mem) {
|
||||
list_del(&mem->node);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(rproc_del_carveout);
|
||||
|
||||
/**
|
||||
* rproc_mem_entry_init() - allocate and initialize rproc_mem_entry struct
|
||||
* @dev: pointer on device struct
|
||||
|
|
|
@ -656,6 +656,7 @@ struct rproc *devm_rproc_alloc(struct device *dev, const char *name,
|
|||
int devm_rproc_add(struct device *dev, struct rproc *rproc);
|
||||
|
||||
void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem);
|
||||
void rproc_del_carveout(struct rproc *rproc, struct rproc_mem_entry *mem);
|
||||
|
||||
struct rproc_mem_entry *
|
||||
rproc_mem_entry_init(struct device *dev,
|
||||
|
|
Loading…
Reference in New Issue