From 035fb90d537540a5fbf24569df74aec667704e4d Mon Sep 17 00:00:00 2001 From: Tadeusz Struk Date: Tue, 11 Oct 2022 11:26:10 -0700 Subject: 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 Message-Id: <20221011182611.116011-1-tadeusz.struk@linaro.org> Signed-off-by: David Gibson --- libfdt/libfdt.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libfdt') diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h index a7f432c..d0a2ed2 100644 --- a/libfdt/libfdt.h +++ b/libfdt/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 -- cgit v1.1