devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libfdt: add fdt_get_property_by_offset_w helper
@ 2022-10-07 19:11 Tadeusz Struk
  2022-10-07 19:11 ` [PATCH v5 2/2] libfdt: tests: add get_next_tag_invalid_prop_len Tadeusz Struk
  2022-10-11  1:52 ` [PATCH 1/2] libfdt: add fdt_get_property_by_offset_w helper David Gibson
  0 siblings, 2 replies; 4+ messages in thread
From: Tadeusz Struk @ 2022-10-07 19:11 UTC (permalink / raw)
  To: David Gibson, Rob Herring; +Cc: devicetree, devicetree-compiler, Tadeusz Struk

Add a new fdt_get_property_by_offset_w helper function.
It is a wrapper on the fdt_get_property_by_offset() cuntion
that returns a writable pointer to a property at a given offset.

Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
---
 libfdt/libfdt.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index a7f432c..cddc2d6 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(const 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
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-11  2:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-07 19:11 [PATCH 1/2] libfdt: add fdt_get_property_by_offset_w helper Tadeusz Struk
2022-10-07 19:11 ` [PATCH v5 2/2] libfdt: tests: add get_next_tag_invalid_prop_len Tadeusz Struk
2022-10-11  2:06   ` David Gibson
2022-10-11  1:52 ` [PATCH 1/2] libfdt: add fdt_get_property_by_offset_w helper David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).