[RFC] dt: export of_have_populated_dt

Grant Likely grant.likely at secretlab.ca
Wed Apr 11 06:33:57 EST 2012


On Tue, 10 Apr 2012 12:20:27 -0500, Rob Herring <robherring2 at gmail.com> wrote:
> On 04/10/2012 11:29 AM, Cousson, Benoit wrote:
> > Hi Chris,
> > 
> > On 4/10/2012 6:21 PM, Chris Ball wrote:
> >> Hi,
> >>
> >> On Tue, Apr 10 2012, Cousson, Benoit wrote:
> >>> Hi Balaji,
> >>>
> >>> On 4/10/2012 5:11 PM, Balaji T K wrote:
> >>>> If of_have_populated_dt is called from module, build fails with
> >>>> "allnodes"
> >>>> undefined error, so remove inline and export of_have_populated_dt.
> >>>
> >>> Is this function really called from the MMC driver?
> >>
> >> ~/git/linux % git grep of_have_populated_dt drivers/
> >> drivers/gpio/gpio-samsung.c:    if (!of_have_populated_dt())
> >> drivers/mmc/host/omap_hsmmc.c:  if (of_have_populated_dt()&&  !vdd)
> >> drivers/mmc/host/omap_hsmmc.c:                  
> >> (!of_have_populated_dt())) {
> > 
> > Gosh, twice... I should be in a wrong branch :-(
> > 
> > Then the next question to Rob...
> > 
> > Rob,
> > Does it make sense to use that in the driver? So far I was using that
> > only in the arch code to make the difference between the DT boot and the
> > non-DT boot.
> > 
> > I guess that a driver should rely on of_match_device or non-NULL
> > device_node to figure out that?
> > 
> 
> Agreed. of_match_device or device_node ptr check is the right approach.

Good; I can safely ignore this patch.  :-)

g.



More information about the devicetree-discuss mailing list