diff options
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r-- | include/dm/ofnode.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 7e9d3be96a2..f68896711e5 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -36,6 +36,25 @@ struct ofnode_phandle_args { static inline void oftree_reset(void) {} /** + * ofnode_to_fdt() - convert an ofnode to a flat DT pointer + * + * This cannot be called if the reference contains a node pointer. + * + * @node: Reference containing offset (possibly invalid) + * Return: DT offset (can be NULL) + */ +static inline void *ofnode_to_fdt(ofnode node) +{ +#ifdef OF_CHECKS + if (of_live_active()) + return NULL; +#endif + + /* Use the control FDT by default */ + return (void *)gd->fdt_blob; +} + +/** * ofnode_to_np() - convert an ofnode to a live DT node pointer * * This cannot be called if the reference contains an offset. |