]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
libfdt: Add fdt_getprop_namelen_w
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 5 Jul 2016 08:26:42 +0000 (10:26 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 20 Aug 2016 15:35:03 +0000 (11:35 -0400)
Add a function to retrieve a writeable property only by the first
characters of its name.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
include/libfdt.h

index f13b01f08f71e23808199b9cde80011e547dbd8f..a55d2d0d8c7b4a3a60bed17a0bf54c1cd9f751f7 100644 (file)
@@ -619,6 +619,13 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
  */
 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
                                const char *name, int namelen, int *lenp);
+static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
+                                         const char *name, int namelen,
+                                         int *lenp)
+{
+       return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name,
+                                                     namelen, lenp);
+}
 
 /**
  * fdt_getprop - retrieve the value of a given property