[PATCH 3.6.0] of: Add missing dummy functions

Grant Likely grant.likely at secretlab.ca
Mon Nov 26 21:38:43 EST 2012


On Wed, 17 Oct 2012 16:32:39 -0500, Rob Herring <robherring2 at gmail.com> wrote:
> On 10/17/2012 05:26 AM, Srinivas KANDAGATLA wrote:
> > From: Srinivas Kandagatla <srinivas.kandagatla at st.com>
> > 
> > Some functions in of.h have dummy functions and real implementations,
> > however few of them have only real implementation.
> > I think to be more consistent this patch adds below dummy functions if
> > for non CONFIG_OF's.
> > 
> 
> Fixing these up one by one has annoyed me, but I know Grant has
> generally resisted blindly creating empty functions. So I would like
> Grant's comments. I'm fine with these except the ones noted below.
> 
> > 	of_find_node_by_type
> 
> This should not be used except a few places as using device_type is
> generally only for true OF.
> 
> > 	of_device_is_available
> > 	of_find_node_with_property
> 
> Only used in 2 places.
> 
> > 	of_find_matching_node
> > 	of_find_node_by_path
> > 	of_find_node_by_phandle
> > 	of_get_parent
> > 	of_get_next_parent
> > 	of_get_next_child
> > 	of_get_next_available_child
> > 	of_get_child_by_name
> 
> Already have this one.
> 
> > 
> > Hopefully this can eliminate the need to ifdef code in the drivers.
> 
> Sometimes we want that for drivers that can be built both for OF and !OF
> and you can't optimize away all the code and data.

Right. I've been cautious here for a reason. As much as possible I want
to encourage of_* calls to be collected together in a driver, not
scattered all over the place. Often the whole block of OF-aware code in
a driver can be compiled out if it is grouped together into a function.

Also, some of these only make sense in the context of an OF-aware code
block and there is no sensible empty version.

So, I'm fine with adding the empty versions on a case-by-case basis, but
not wholesale.

g.



More information about the devicetree-discuss mailing list