From: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Frank Rowand
<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"open list:OPEN FIRMWARE AND..."
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
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-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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
--
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
WARNING: multiple messages have this Message-ID (diff)
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
next prev parent reply other threads:[~2016-06-14 7:41 UTC|newest]
Thread overview: 38+ 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-01 8:34 ` Daniel Lezcano
[not found] ` <1464770093-12667-2-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-06-14 7:41 ` Daniel Lezcano [this message]
2016-06-14 7:41 ` Daniel Lezcano
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 ` Daniel Lezcano
[not found] ` <1464770093-12667-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
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 ` Daniel Lezcano
2016-06-01 8:34 ` Daniel Lezcano
2016-06-01 8:34 ` [PATCH 4/9] clocksource/drivers/mkt_timer: " Daniel Lezcano
2016-06-01 8:34 ` Daniel Lezcano
2016-06-01 8:34 ` Daniel Lezcano
2016-06-01 8:34 ` [PATCH 5/9] clocksource/drivers/exynos_mct: " Daniel Lezcano
2016-06-01 8:34 ` Daniel Lezcano
2016-06-01 8:34 ` Daniel Lezcano
2016-06-06 10:51 ` Krzysztof Kozlowski
2016-06-06 10:51 ` Krzysztof Kozlowski
2016-06-06 11:23 ` Daniel Lezcano
2016-06-06 11:23 ` Daniel Lezcano
2016-06-06 11:28 ` Krzysztof Kozlowski
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 8:34 ` Daniel Lezcano
2016-06-01 14:36 ` Sören Brinkmann
2016-06-01 14:36 ` Sören Brinkmann
2016-06-01 14:43 ` Daniel Lezcano
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 ` 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-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.