# \[PATCH v5 4/8\] libfdt: Add fdt\_getprop\_namelen\_w

- From: Maxime Ripard \<hidden\>
- Date: 2016-07-29 09:55:47 
- List: linux-devicetree
- Page: https://ratatoskr.run/linux-devicetree/2016/07/8125960
- Thread: https://ratatoskr.run/linux-devicetree/2016/07/8125960/t.md

```text
Add a function to retrieve a writeable property only by the first
characters of its name.

Reviewed-by: David Gibson <redacted>
Signed-off-by: Maxime Ripard <redacted>
---
 libfdt/libfdt.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index 06b84cc16bbf..0189350fb32f 100644
--- a/libfdt/libfdt.h
+++ b/libfdt/libfdt.h
@@ -629,6 +629,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
-- 
2.9.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
