[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC 08/29] xen/arm: Add helpers to use the device tree



On Mon, 2013-04-29 at 00:01 +0100, Julien Grall wrote:

Are these also from Linux?

> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
> ---
>  xen/common/device_tree.c      |  120 
> +++++++++++++++++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h |  120 
> +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 240 insertions(+)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 05285b7..dd4b813 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -573,6 +573,54 @@ const void *dt_get_property(const struct dt_device_node 
> *np,
>      return pp ? pp->value : NULL;
>  }
>  
> +bool_t dt_device_is_compatible(const struct dt_device_node *device,
> +                               const char *compat)
> +{
> +    const char* cp;
> +    u32 cplen, l;
> +
> +    cp = dt_get_property(device, "compatible", &cplen);
> +    if ( cp == NULL )
> +        return 0;
> +    while ( cplen > 0 )
> +    {
> +        if ( dt_compat_cmp(cp, compat, strlen(compat)) == 0 )

We have functions which do this already, don't we? Also things like
dt_node_cmp, dt_read_number etc have analogues in the current code.

If these are from Linux I'm inclined to believe they will be better than
our own. For 4.4 we should look at removing our variants.

Or maybe if I keep reading the series I will find them going away
already?

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.