[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V2 07/33] xen/arm: Create a hierarchical device tree
On Wed, 2013-05-08 at 03:33 +0100, Julien Grall wrote: > +/** > + * Dump device tree message with printk > + * TODO: Find another way to switch between early_printk and printk > + * int the device tree code > + */ > +void __init dt_switch_to_printk(void); The issue here is that there is code which wants to log which can be called either via dt_unflatten_host_device_tree or later on? There seems to be at least some calls to dt_dprintk which are only called via dt_unfla..., I think these can and should just use early_printk (or a macro to make them a debug thing). Likewise if there are functions which are only called later then they should just use printk direct (or a macro..) Which only leaves ones which are both? How many are these? I'm inclined towards suggesting that if they are debug prints which are disabled by default and require a recompile to enable then the person doing the debugging can select whether they care about early or late messages by #define-ing DEBUG or EARLY_DEBUG or both as required. > +/** > + * Host device tree > + * DO NOT modify it! Can it be const? > + */ > +extern struct dt_device_node *dt_host; > + > +#define dt_node_cmp(s1, s2) strcmp((s1), (s2)) > +#define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l) > + > +#define for_each_property_of_node(dn, pp) \ > + for ( pp = dn->properties; pp != NULL; pp = pp->next ) > + > +#define for_each_device_node(dt, dn) \ > + for ( dn = dt; dn != NULL; dn = dn->allnext ) > + > +static inline const char *dt_node_full_name(const struct dt_device_node *np) > +{ > + return (np && np->full_name) ? np->full_name : "<no-node>"; > +} > + > +/** > + * Find a property with a given name for a given node > + * and return the value. > + */ > +const void *dt_get_property(const struct dt_device_node *np, > + const char *name, u32 *lenp); > + > +/** > + * dt_find_node_by_path - Find a node matching a full DT path > + * @path: The full path to match > + * > + * Returns a node pointer. > + */ > +struct dt_device_node *dt_find_node_by_path(const char *path); > #endif > -- > Julien Grall > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |