From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from londo.lunn.ch ([80.238.139.98]:45672 "EHLO londo.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062Ab2JBT7X (ORCPT ); Tue, 2 Oct 2012 15:59:23 -0400 Date: Tue, 2 Oct 2012 21:59:14 +0200 From: Andrew Lunn To: Fabio Porcedda Cc: Andrew Lunn , Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Ferre , Jean-Christophe PLAGNIOL-VILLARD , Andrew Victor , Jason Cooper , devicetree-discuss@lists.ozlabs.org Subject: Re: [PATCH v6 3/5] watchdog: at91sam9_wdt: add device tree support Message-ID: <20121002195914.GG21046@lunn.ch> References: <1349094281-28889-1-git-send-email-fabio.porcedda@gmail.com> <1349094281-28889-4-git-send-email-fabio.porcedda@gmail.com> <20121001124546.GE11837@lunn.ch> <20121001130658.GG11837@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org > I was thinking to add a more generic helper function like this: > > static inline void watchdog_get_dttimeout(struct device_node *node, > u32 *timeout) > { > if (node) > of_property_read_u32(node, "timeout", &wdd->timeout); > } You forgot to change the function signature. Also, if you are adding a generic function, it should be a generic function for the framework. All drivers should be slowly moving towards the framework, so adding functions which help you not move towards the framework are wrong. Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew@lunn.ch (Andrew Lunn) Date: Tue, 2 Oct 2012 21:59:14 +0200 Subject: [PATCH v6 3/5] watchdog: at91sam9_wdt: add device tree support In-Reply-To: References: <1349094281-28889-1-git-send-email-fabio.porcedda@gmail.com> <1349094281-28889-4-git-send-email-fabio.porcedda@gmail.com> <20121001124546.GE11837@lunn.ch> <20121001130658.GG11837@lunn.ch> Message-ID: <20121002195914.GG21046@lunn.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > I was thinking to add a more generic helper function like this: > > static inline void watchdog_get_dttimeout(struct device_node *node, > u32 *timeout) > { > if (node) > of_property_read_u32(node, "timeout", &wdd->timeout); > } You forgot to change the function signature. Also, if you are adding a generic function, it should be a generic function for the framework. All drivers should be slowly moving towards the framework, so adding functions which help you not move towards the framework are wrong. Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH v6 3/5] watchdog: at91sam9_wdt: add device tree support Date: Tue, 2 Oct 2012 21:59:14 +0200 Message-ID: <20121002195914.GG21046@lunn.ch> References: <1349094281-28889-1-git-send-email-fabio.porcedda@gmail.com> <1349094281-28889-4-git-send-email-fabio.porcedda@gmail.com> <20121001124546.GE11837@lunn.ch> <20121001130658.GG11837@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: 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: Fabio Porcedda Cc: Andrew Lunn , linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Wim Van Sebroeck , Andrew Victor , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Jason Cooper List-Id: devicetree@vger.kernel.org > I was thinking to add a more generic helper function like this: > > static inline void watchdog_get_dttimeout(struct device_node *node, > u32 *timeout) > { > if (node) > of_property_read_u32(node, "timeout", &wdd->timeout); > } You forgot to change the function signature. Also, if you are adding a generic function, it should be a generic function for the framework. All drivers should be slowly moving towards the framework, so adding functions which help you not move towards the framework are wrong. Andrew