summaryrefslogtreecommitdiffstats
path: root/cpukit/include/libfdt.h
diff options
context:
space:
mode:
authorTadeusz Struk <tadeusz.struk@linaro.org>2022-10-11 11:26:10 -0700
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-12-22 08:02:57 +0100
commit8632d58f971cb2a8f9a6ba20592f0f8af964d7d4 (patch)
treecba45e3c08f3f9782f37f6fe23227b3867e522d6 /cpukit/include/libfdt.h
parentlibdtc: remove duplicate judgments (diff)
downloadrtems-8632d58f971cb2a8f9a6ba20592f0f8af964d7d4.tar.bz2
libfdt: add fdt_get_property_by_offset_w helper
Add a new fdt_get_property_by_offset_w helper function. It is a wrapper on fdt_get_property_by_offset that returns a writable pointer to a property at a given offset. Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org> Message-Id: <20221011182611.116011-1-tadeusz.struk@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'cpukit/include/libfdt.h')
-rw-r--r--cpukit/include/libfdt.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h
index a7f432c80c..d0a2ed2741 100644
--- a/cpukit/include/libfdt.h
+++ b/cpukit/include/libfdt.h
@@ -660,6 +660,13 @@ int fdt_next_property_offset(const void *fdt, int offset);
const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
int offset,
int *lenp);
+static inline struct fdt_property *fdt_get_property_by_offset_w(void *fdt,
+ int offset,
+ int *lenp)
+{
+ return (struct fdt_property *)(uintptr_t)
+ fdt_get_property_by_offset(fdt, offset, lenp);
+}
/**
* fdt_get_property_namelen - find a property based on substring