mirror of
https://github.com/dgibson/dtc.git
synced 2026-04-12 00:47:46 -04:00
livetree: Set phandle properties type to uint32
Generated phandle property values are a single cell, so set the type marker to uint32. Otherwise, we default to uint8. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
853649acce
commit
3fe0eeda0b
1 changed files with 6 additions and 6 deletions
12
livetree.c
12
livetree.c
|
|
@ -594,6 +594,7 @@ struct node *get_node_by_ref(struct node *tree, const char *ref)
|
||||||
cell_t get_node_phandle(struct node *root, struct node *node)
|
cell_t get_node_phandle(struct node *root, struct node *node)
|
||||||
{
|
{
|
||||||
static cell_t phandle = 1; /* FIXME: ick, static local */
|
static cell_t phandle = 1; /* FIXME: ick, static local */
|
||||||
|
struct data d = empty_data;
|
||||||
|
|
||||||
if ((node->phandle != 0) && (node->phandle != -1))
|
if ((node->phandle != 0) && (node->phandle != -1))
|
||||||
return node->phandle;
|
return node->phandle;
|
||||||
|
|
@ -603,17 +604,16 @@ cell_t get_node_phandle(struct node *root, struct node *node)
|
||||||
|
|
||||||
node->phandle = phandle;
|
node->phandle = phandle;
|
||||||
|
|
||||||
|
d = data_add_marker(d, TYPE_UINT32, NULL);
|
||||||
|
d = data_append_cell(d, phandle);
|
||||||
|
|
||||||
if (!get_property(node, "linux,phandle")
|
if (!get_property(node, "linux,phandle")
|
||||||
&& (phandle_format & PHANDLE_LEGACY))
|
&& (phandle_format & PHANDLE_LEGACY))
|
||||||
add_property(node,
|
add_property(node, build_property("linux,phandle", d));
|
||||||
build_property("linux,phandle",
|
|
||||||
data_append_cell(empty_data, phandle)));
|
|
||||||
|
|
||||||
if (!get_property(node, "phandle")
|
if (!get_property(node, "phandle")
|
||||||
&& (phandle_format & PHANDLE_EPAPR))
|
&& (phandle_format & PHANDLE_EPAPR))
|
||||||
add_property(node,
|
add_property(node, build_property("phandle", d));
|
||||||
build_property("phandle",
|
|
||||||
data_append_cell(empty_data, phandle)));
|
|
||||||
|
|
||||||
/* If the node *does* have a phandle property, we must
|
/* If the node *does* have a phandle property, we must
|
||||||
* be dealing with a self-referencing phandle, which will be
|
* be dealing with a self-referencing phandle, which will be
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue