[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260112142009.1006236-69-herve.codina@bootlin.com>
Date: Mon, 12 Jan 2026 15:19:58 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: David Gibson <david@...son.dropbear.id.au>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: Ayush Singh <ayush@...gleboard.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
devicetree-compiler@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
devicetree-spec@...r.kernel.org,
Hui Pu <hui.pu@...ealthcare.com>,
Ian Ray <ian.ray@...ealthcare.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Herve Codina <herve.codina@...tlin.com>
Subject: [RFC PATCH 68/77] libfdt: Introduce fdt_getprop_by_offset_w()
The future support for applying a addon on a base device-tree needs to
modify properties retrieved by their offset.
fdt_getprop_by_offset() already exists to get a preperty by its offset
but the property returned is read-only. A writable returned property is
needed.
Fill the lack and introduce fdt_getprop_by_offset_w(), the write enabled
variant of fdt_getprop_by_offset().
Signed-off-by: Herve Codina <herve.codina@...tlin.com>
---
libfdt/libfdt.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index 37459a6..0c654b1 100644
--- a/libfdt/libfdt.h
+++ b/libfdt/libfdt.h
@@ -858,6 +858,12 @@ static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
#ifndef SWIG /* This function is not useful in Python */
const void *fdt_getprop_by_offset(const void *fdt, int offset,
const char **namep, int *lenp);
+static inline void *fdt_getprop_by_offset_w(const void *fdt, int offset,
+ const char **namep, int *lenp)
+{
+ return (void *)(uintptr_t)fdt_getprop_by_offset(fdt, offset, namep,
+ lenp);
+}
#endif
/**
--
2.52.0
Powered by blists - more mailing lists