Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1421636
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/9] of: Add a new macro to declare_of for one parameter function returning a value |
| Date | 2016-06-14 09:50 +0200 |
| Message-ID | <rJRgJ-1Ld-7@gated-at.bofh.it> (permalink) |
| References | <rF9R0-641-9@gated-at.bofh.it> <rFaam-6aY-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 1/9] of: Add a new macro to declare_of for one parameter function returning a value Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-06-14 09:50 +0200
csiph-web