[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1afe75e1-ab57-a321-d319-2d1b8d2b199d@foss.st.com>
Date: Thu, 30 Jun 2022 18:38:12 +0200
From: Arnaud POULIQUEN <arnaud.pouliquen@...s.st.com>
To: Chris Lew <quic_clew@...cinc.com>, <bjorn.andersson@...aro.org>,
<mathieu.poirier@...aro.org>
CC: <linux-remoteproc@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] remoteproc: core: Introduce rproc_mem_entry_free
On 6/10/22 21:23, Chris Lew wrote:
> 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.
>
> Signed-off-by: Chris Lew <quic_clew@...cinc.com>
> ---
> drivers/remoteproc/remoteproc_core.c | 13 +++++++++++++
> include/linux/remoteproc.h | 1 +
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index ee71fccae970..161691fd2e96 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -1069,6 +1069,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);
Same concerns for this one.
> +
> +/**
> * rproc_of_resm_mem_entry_init() - allocate and initialize rproc_mem_entry struct
> * from a reserved memory phandle
> * @dev: pointer on device struct
> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
> index 43112aa78ffe..9b039f37da12 100644
> --- a/include/linux/remoteproc.h
> +++ b/include/linux/remoteproc.h
> @@ -666,6 +666,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,
Powered by blists - more mailing lists