aboutsummaryrefslogtreecommitdiff
path: root/include/dm/ofnode.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-09-06 20:27:04 -0600
committerTom Rini <trini@konsulko.com>2022-09-29 16:07:58 -0400
commit98306987659769607642474954b2bf9555808542 (patch)
tree779abc4e47dd80c57d93b3538fa3a79f7fbba997 /include/dm/ofnode.h
parentc3a194dec97be3ceb74ba2c980e635aee1644d94 (diff)
downloadu-boot-98306987659769607642474954b2bf9555808542.zip
u-boot-98306987659769607642474954b2bf9555808542.tar.gz
u-boot-98306987659769607642474954b2bf9555808542.tar.bz2
dm: core: Drop the const from ofnode
Now that we support writing to ofnodes, the const is not accurate. Drop it to avoid undesirable casting. Also drop the ofnode_to_npw() which is now the same as ofnode_to_np(). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r--include/dm/ofnode.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index ec1ab0c..044546f 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -35,7 +35,7 @@ struct ofnode_phandle_args {
* @node: Reference containing struct device_node * (possibly invalid)
* Return: pointer to device node (can be NULL)
*/
-static inline const struct device_node *ofnode_to_np(ofnode node)
+static inline struct device_node *ofnode_to_np(ofnode node)
{
#ifdef OF_CHECKS
if (!of_live_active())
@@ -45,24 +45,6 @@ static inline const struct device_node *ofnode_to_np(ofnode node)
}
/**
- * ofnode_to_npw() - convert an ofnode to a writeable live DT node pointer
- *
- * This cannot be called if the reference contains an offset.
- *
- * @node: Reference containing struct device_node * (possibly invalid)
- * Return: pointer to device node (can be NULL)
- */
-static inline struct device_node *ofnode_to_npw(ofnode node)
-{
-#ifdef OF_CHECKS
- if (!of_live_active())
- return NULL;
-#endif
- /* Drop constant */
- return (struct device_node *)node.np;
-}
-
-/**
* ofnode_to_offset() - convert an ofnode to a flat DT offset
*
* This cannot be called if the reference contains a node pointer.
@@ -117,7 +99,7 @@ static inline ofnode offset_to_ofnode(int of_offset)
* @np: Live node pointer (can be NULL)
* Return: reference to the associated node pointer
*/
-static inline ofnode np_to_ofnode(const struct device_node *np)
+static inline ofnode np_to_ofnode(struct device_node *np)
{
ofnode node;