Re: [PATCH 02/15] of: add devicetree probing support

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

 



> +		    !strcmp(pp->name, "linux,phandle"))
> +			continue;
> +
> +		np = of_find_node_by_path(pp->value);
> +		if (!np)
> +			continue;
> +
> +		/* walk the alias backwards to extract the id and work out
> +		 * the 'stem' string */
> +		while (isdigit(*(end-1)) && end > start)
> +			end--;
> +		len = end - start;
> +
> +		id = simple_strtol(end, 0, 10);
> +		if (id < 0)
> +			continue;
> +
> +		/* Allocate an alias_prop with enough space for the stem */
> +		ap = xzalloc(sizeof(*ap) + len + 1);
xzalloc does not if nomem
> +		if (!ap)
> +			continue;
> +		ap->alias = start;
> +		of_alias_add(ap, np, id, start, len);
> +	}
> +}
> +
Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux