From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: kernel@stlinux.com, patrice.chotard@st.com, ohad@wizery.com,
bjorn.andersson@linaro.org, ssantosh@kernel.org,
linux-remoteproc@vger.kernel.org, ludovic.barre@st.com,
s-anna@ti.com, loic.pallardy@st.com
Subject: [PATCH 3/2+1] remoteproc: core: Move of_get_rproc() helper to header
Date: Tue, 16 Aug 2016 15:52:12 +0100 [thread overview]
Message-ID: <20160816145212.GA4254@dell> (raw)
In-Reply-To: <20160816143824.4120-1-lee.jones@linaro.org>
remoteproc: core: Move of_get_rproc() helper to header
Since of_get_rproc() has been made a simple helper, we can move it
to the remoteproc.h and make it a 'static inline'.
Suggested-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 1c5d5d8..6966fb2 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1267,25 +1267,6 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name)
return of_get_rproc_by_index(np, index);
}
EXPORT_SYMBOL(of_get_rproc_by_name);
-
-/**
- * of_get_rproc() - lookup and obtain a reference to an rproc
- * @np: node to search for rproc
- *
- * Finds an rproc handle using the default remote processor's phandle,
- * and then returns a handle to the rproc.
- *
- * This function increments the remote processor's refcount, so always
- * use rproc_put() to decrement it back once rproc isn't needed anymore.
- *
- * Returns a pointer to the rproc struct on success or an appropriate error
- * code otherwise.
- */
-struct rproc *of_get_rproc(struct device_node *np)
-{
- return of_get_rproc_by_index(np, 0);
-}
-EXPORT_SYMBOL(of_get_rproc);
#endif
/**
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 0e1adc9..ec1cffd 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -515,7 +515,6 @@ extern struct rproc *of_get_rproc_by_index(struct device_node *np,
int index);
extern struct rproc *of_get_rproc_by_name(struct device_node *np,
const char *name);
-extern struct rproc *of_get_rproc(struct device_node *np);
#else
static inline
struct rproc *of_get_rproc_by_index(struct device_node *np, int index)
@@ -527,11 +526,24 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name)
{
return NULL;
}
-static inline
-struct rproc *of_get_rproc(struct device_node *np)
+#endif /* CONFIG_OF */
+
+/**
+ * of_get_rproc() - lookup and obtain a reference to an rproc
+ * @np: node to search for rproc
+ *
+ * Finds an rproc handle using the default remote processor's phandle,
+ * and then returns a handle to the rproc.
+ *
+ * This function increments the remote processor's refcount, so always
+ * use rproc_put() to decrement it back once rproc isn't needed anymore.
+ *
+ * Returns a pointer to the rproc struct on success or an appropriate error
+ * code otherwise.
+ */
+static inline struct rproc *of_get_rproc(struct device_node *np)
{
- return NULL;
+ return of_get_rproc_by_index(np, 0);
}
-#endif /* CONFIG_OF */
#endif /* REMOTEPROC_H */
WARNING: multiple messages have this Message-ID (diff)
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/2+1] remoteproc: core: Move of_get_rproc() helper to header
Date: Tue, 16 Aug 2016 15:52:12 +0100 [thread overview]
Message-ID: <20160816145212.GA4254@dell> (raw)
In-Reply-To: <20160816143824.4120-1-lee.jones@linaro.org>
remoteproc: core: Move of_get_rproc() helper to header
Since of_get_rproc() has been made a simple helper, we can move it
to the remoteproc.h and make it a 'static inline'.
Suggested-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 1c5d5d8..6966fb2 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1267,25 +1267,6 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name)
return of_get_rproc_by_index(np, index);
}
EXPORT_SYMBOL(of_get_rproc_by_name);
-
-/**
- * of_get_rproc() - lookup and obtain a reference to an rproc
- * @np: node to search for rproc
- *
- * Finds an rproc handle using the default remote processor's phandle,
- * and then returns a handle to the rproc.
- *
- * This function increments the remote processor's refcount, so always
- * use rproc_put() to decrement it back once rproc isn't needed anymore.
- *
- * Returns a pointer to the rproc struct on success or an appropriate error
- * code otherwise.
- */
-struct rproc *of_get_rproc(struct device_node *np)
-{
- return of_get_rproc_by_index(np, 0);
-}
-EXPORT_SYMBOL(of_get_rproc);
#endif
/**
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 0e1adc9..ec1cffd 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -515,7 +515,6 @@ extern struct rproc *of_get_rproc_by_index(struct device_node *np,
int index);
extern struct rproc *of_get_rproc_by_name(struct device_node *np,
const char *name);
-extern struct rproc *of_get_rproc(struct device_node *np);
#else
static inline
struct rproc *of_get_rproc_by_index(struct device_node *np, int index)
@@ -527,11 +526,24 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name)
{
return NULL;
}
-static inline
-struct rproc *of_get_rproc(struct device_node *np)
+#endif /* CONFIG_OF */
+
+/**
+ * of_get_rproc() - lookup and obtain a reference to an rproc
+ * @np: node to search for rproc
+ *
+ * Finds an rproc handle using the default remote processor's phandle,
+ * and then returns a handle to the rproc.
+ *
+ * This function increments the remote processor's refcount, so always
+ * use rproc_put() to decrement it back once rproc isn't needed anymore.
+ *
+ * Returns a pointer to the rproc struct on success or an appropriate error
+ * code otherwise.
+ */
+static inline struct rproc *of_get_rproc(struct device_node *np)
{
- return NULL;
+ return of_get_rproc_by_index(np, 0);
}
-#endif /* CONFIG_OF */
#endif /* REMOTEPROC_H */
next prev parent reply other threads:[~2016-08-16 14:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 14:38 [PATCH v2 1/2] remoteproc: core: Add rproc OF look-up functions Lee Jones
2016-08-16 14:38 ` Lee Jones
2016-08-16 14:38 ` [PATCH v2 2/2] remoteproc: core: Rework obtaining a rproc from a DT phandle Lee Jones
2016-08-16 14:38 ` Lee Jones
2016-08-16 14:52 ` Lee Jones [this message]
2016-08-16 14:52 ` [PATCH 3/2+1] remoteproc: core: Move of_get_rproc() helper to header Lee Jones
2016-10-18 17:45 ` [PATCH v2 1/2] remoteproc: core: Add rproc OF look-up functions Bjorn Andersson
2016-10-18 17:45 ` Bjorn Andersson
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=20160816145212.GA4254@dell \
--to=lee.jones@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=kernel@stlinux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=loic.pallardy@st.com \
--cc=ludovic.barre@st.com \
--cc=ohad@wizery.com \
--cc=patrice.chotard@st.com \
--cc=s-anna@ti.com \
--cc=ssantosh@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.