From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751789AbcFNHlw (ORCPT ); Tue, 14 Jun 2016 03:41:52 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37313 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbcFNHlv (ORCPT ); Tue, 14 Jun 2016 03:41:51 -0400 Subject: Re: [PATCH 1/9] of: Add a new macro to declare_of for one parameter function returning a value To: tglx@linutronix.de References: <1464770093-12667-1-git-send-email-daniel.lezcano@linaro.org> <1464770093-12667-2-git-send-email-daniel.lezcano@linaro.org> Cc: linux-kernel@vger.kernel.org, Rob Herring , Frank Rowand , "open list:OPEN FIRMWARE AND..." , Grant Likely From: Daniel Lezcano Message-ID: <575FB53D.8030107@linaro.org> Date: Tue, 14 Jun 2016 09:41:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1464770093-12667-2-git-send-email-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/01/2016 10:34 AM, Daniel Lezcano wrote: > The macro OF_DECLARE_1 expect a void (*func)(struct device_node *) while the > OF_DECLARE_2 expect a int (*func)(struct device_node *, struct device_node *). > > The second one allows to pass an init function returning a value, which make > possible to call the functions in the table and check the return value in order > to catch at a higher level the errors and handle them from there instead of > doing a panic in each driver (well at least this is the case for the clkevt). > > Unfortunately the OF_DECLARE_1 does not allow that and that lead to some code > duplication and crappyness in the drivers. > > The OF_DECLARE_1 is used by all the clk drivers and the clocksource/clockevent > drivers. It is not possible to do the change in one shot as we have to change > all the init functions. > > The OF_DECLARE_2 specifies an init function prototype with two parameters with > the node and its parent. The latter won't be used, ever, in the timer drivers. > > Introduce a OF_DECLARE_1_RET macro to be used, and hopefully we can smoothly > and iteratively change the users of OF_DECLARE_1 to use the new macro instead. > > Signed-off-by: Daniel Lezcano > --- Rob, Grant, do you agree with this change ? Thanks. -- Daniel -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog