From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Porcedda Subject: [PATCH v5 1/8] dt: add helper inline for retrieving timeout-sec property Date: Mon, 19 Nov 2012 15:10:36 +0100 Message-ID: <1353334243-16703-2-git-send-email-fabio.porcedda@gmail.com> References: <1353334243-16703-1-git-send-email-fabio.porcedda@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1353334243-16703-1-git-send-email-fabio.porcedda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Wim Van Sebroeck , linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Nicolas Ferre , Jean-Christophe PLAGNIOL-VILLARD , Andrew Victor , Jason Cooper , Andrew Lunn , Ben Dooks , Kukjin Kim Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Rob Herring List-Id: devicetree@vger.kernel.org The first user of this function is the watchdog framework. Signed-off-by: Fabio Porcedda Cc: Grant Likely Cc: Rob Herring --- include/linux/of.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/of.h b/include/linux/of.h index b4e50d5..d60fde9 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -477,4 +477,15 @@ static inline int of_property_read_u32(const struct device_node *np, return of_property_read_u32_array(np, propname, out_value, 1); } +/** + * of_get_timeout_sec() - Helper to read the timeout_sec property + * @np: device node from which the property value is to be read. + * @timeout: adress of the output value + */ +static inline int of_get_timeout_sec(const struct device_node *np, + u32 *timeout) +{ + return of_property_read_u32(np, "timeout-sec", timeout); +} + #endif /* _LINUX_OF_H */ -- 1.8.0