diff options
author | Madhavan Srinivasan <maddy@linux.vnet.ibm.com> | 2017-06-22 17:45:17 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-27 15:31:52 +1000 |
commit | 3ae55cca0ea3609bd90f2208b492cda37abb1cfe (patch) | |
tree | 77c0787e6dd9b31331b7e6b417f358e713c7f544 /include/device.h | |
parent | 7e6499674f154d62d2f136778877cce8f6710df5 (diff) | |
download | skiboot-3ae55cca0ea3609bd90f2208b492cda37abb1cfe.zip skiboot-3ae55cca0ea3609bd90f2208b492cda37abb1cfe.tar.gz skiboot-3ae55cca0ea3609bd90f2208b492cda37abb1cfe.tar.bz2 |
dt: Add helper function for last_phandle updates
Add helper functions for "last_phandle" access/update and
modify functions to use helper functions.
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/device.h')
-rw-r--r-- | include/device.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h index 5155daa..c51b3ee 100644 --- a/include/device.h +++ b/include/device.h @@ -61,6 +61,22 @@ struct dt_node *dt_new_root(const char *name); /* Graft a root node into this tree. */ bool dt_attach_root(struct dt_node *parent, struct dt_node *root); +/* Wrappers for last_phandle operations */ +static inline u32 get_last_phandle(void) +{ + return last_phandle; +} + +static inline void set_last_phandle(u32 phandle) +{ + last_phandle = phandle; +} + +static inline u32 new_phandle(void) +{ + return ++last_phandle; +} + /* Add a child node. */ struct dt_node *dt_new(struct dt_node *parent, const char *name); struct dt_node *dt_new_addr(struct dt_node *parent, const char *name, |