From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: [PATCH v5 4/8] libfdt: Add fdt_getprop_namelen_w Date: Fri, 29 Jul 2016 11:55:47 +0200 Message-ID: <20160729095551.13592-5-maxime.ripard@free-electrons.com> References: <20160729095551.13592-1-maxime.ripard@free-electrons.com> Return-path: In-Reply-To: <20160729095551.13592-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: David Gibson Cc: Pantelis Antoniou , Simon Glass , Boris Brezillon , Alexander Kaplan , Thomas Petazzoni , devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, =?UTF-8?q?Antoine=20T=C3=A9nart?= , Stefan Agner , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Maxime Ripard List-Id: devicetree@vger.kernel.org Add a function to retrieve a writeable property only by the first characters of its name. Reviewed-by: David Gibson Signed-off-by: Maxime Ripard --- 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