mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Lew <quic_clew@quicinc.com>
To: <bjorn.andersson@linaro.org>, <mathieu.poirier@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<quic_clew@quicinc.com>
Subject: [PATCH 2/2] remoteproc: core: Introduce rproc_mem_entry_free
Date: Fri, 10 Jun 2022 12:23:05 -0700	[thread overview]
Message-ID: <1654888985-3846-3-git-send-email-quic_clew@quicinc.com> (raw)
In-Reply-To: <1654888985-3846-1-git-send-email-quic_clew@quicinc.com>

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@quicinc.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);
+
+/**
  * 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,
-- 
2.7.4


  parent reply	other threads:[~2022-06-10 19:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 19:23 [PATCH 0/2] Introduce helpers for carveout management Chris Lew
2022-06-10 19:23 ` [PATCH 1/2] remoteproc: core: Introduce rproc_del_carveout Chris Lew
2022-06-30 16:36   ` Arnaud POULIQUEN
2022-07-06  4:57     ` Chris Lew
2022-06-10 19:23 ` Chris Lew [this message]
2022-06-30 16:38   ` [PATCH 2/2] remoteproc: core: Introduce rproc_mem_entry_free Arnaud POULIQUEN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1654888985-3846-3-git-send-email-quic_clew@quicinc.com \
    --to=quic_clew@quicinc.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®