[U-Boot] [PATCH] fdt: Add function to alloc phandle values

Timur Tabi timur at freescale.com
Fri Jul 9 23:28:42 CEST 2010


On Fri, Jul 9, 2010 at 4:22 PM, Kumar Gala <galak at kernel.crashing.org> wrote:

> +int fdt_alloc_phandle(void *blob)
> +{
> +       int offset, len, phandle = 0;
> +       const u32 *val;
> +        for (offset = fdt_next_node(blob, -1, NULL); offset >= 0;
> +             offset = fdt_next_node(blob, offset, NULL)) {
> +                val = fdt_getprop(blob, offset, "linux,phandle", &len);
> +               if (val) phandle = max(*val, phandle);
> +        }
>
> +       return phandle + 1;
> +}

If you incorporate my patch titled, "libfdt: introduce function
fdt_get_max_phandle", you can simplify this function.

Wolfgang rejected that patch because I didn't include any code that
called fdt_get_max_phandle().  I see you're doing the same thing here
with fdt_alloc_phandle().  It will be interesting to see if Wolfgang
rejects your patch.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list