linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	"open list:OPEN FIRMWARE AND..." <devicetree@vger.kernel.org>,
	Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [PATCH 1/9] of: Add a new macro to declare_of for one parameter function returning a value
Date: Tue, 14 Jun 2016 09:41:49 +0200	[thread overview]
Message-ID: <575FB53D.8030107@linaro.org> (raw)
In-Reply-To: <1464770093-12667-2-git-send-email-daniel.lezcano@linaro.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 <daniel.lezcano@linaro.org>
> ---

Rob, Grant,

do you agree with this change ?

Thanks.

   -- Daniel

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  reply	other threads:[~2016-06-14  7:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  8:34 [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling Daniel Lezcano
2016-06-01  8:34 ` [PATCH 1/9] of: Add a new macro to declare_of for one parameter function returning a value Daniel Lezcano
2016-06-14  7:41   ` Daniel Lezcano [this message]
2016-06-01  8:34 ` [PATCH 2/9] clocksource/drivers/clksrc-probe: Introduce init functions with return code Daniel Lezcano
2016-06-01  8:34 ` [PATCH 3/9] clocksource/drivers/rockchip_timer: Convert init function to return error Daniel Lezcano
2016-06-01  8:34 ` [PATCH 4/9] clocksource/drivers/mkt_timer: " Daniel Lezcano
2016-06-01  8:34 ` [PATCH 5/9] clocksource/drivers/exynos_mct: " Daniel Lezcano
2016-06-06 10:51   ` Krzysztof Kozlowski
2016-06-06 11:23     ` Daniel Lezcano
2016-06-06 11:28       ` Krzysztof Kozlowski
2016-06-01  8:34 ` [PATCH 6/9] clocksource/drivers/asm9260: " Daniel Lezcano
2016-06-01  8:34 ` [PATCH 7/9] clocksource/drivers/cadence_ttc: " Daniel Lezcano
2016-06-01 14:36   ` Sören Brinkmann
2016-06-01 14:43     ` Daniel Lezcano
2016-06-01  8:34 ` [PATCH 8/9] clocksource/drivers/st_lpc: " Daniel Lezcano
2016-06-01  8:34 ` [PATCH 9/9] clocksource/drivers/dw_apb_timer: " Daniel Lezcano
2016-06-07  9:54 ` [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling Geert Uytterhoeven
2016-06-07 11:35   ` Daniel Lezcano
2016-06-07 22:23   ` Daniel Lezcano
2016-06-08 14:10   ` Daniel Lezcano
2016-06-09  7:46     ` Geert Uytterhoeven
2016-06-09  7:49       ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=575FB53D.8030107@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).