Permalink
Browse files

dtc: Generate phandle as hash of reference

For non-existent nodes if -@ is passed, generate hash of the reference.

Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
  • Loading branch information...
1 parent 0c7b9f5 commit cdd6692e03c8af1a52d86ae39a685ec8a13d5234 Joel A Fernandes committed Jan 6, 2013
Showing with 1 addition and 50 deletions.
  1. +1 −50 scripts/dtc/checks.c
View
@@ -483,41 +483,7 @@ static void fixup_phandle_references(struct check *c, struct node *dt,
}
if (!refnode) {
- /* allocate fixup entry */
- fe = xmalloc(sizeof(*fe));
-
- fe->node = node;
- fe->prop = prop;
- fe->offset = m->offset;
- fe->next = NULL;
-
- /* search for an already existing fixup */
- for_each_fixup(dt, f)
- if (strcmp(f->ref, m->ref) == 0)
- break;
-
- /* no fixup found, add new */
- if (f == NULL) {
- f = xmalloc(sizeof(*f));
- f->ref = m->ref;
- f->entries = NULL;
- f->next = NULL;
-
- /* add it to the tree */
- fp = &dt->fixups;
- while (*fp)
- fp = &(*fp)->next;
- *fp = f;
- }
-
- /* and now append fixup entry */
- fep = &f->entries;
- while (*fep)
- fep = &(*fep)->next;
- *fep = fe;
-
- /* mark the entry as unresolved */
- phandle = 0xdeadbeef;
+ crc32(m->ref, strlen(m->ref), &phandle);
} else {
phandle = get_node_phandle(dt, refnode);
@@ -743,21 +709,6 @@ static void check_auto_label_phandles(struct check *c, struct node *dt,
/* force allocation of a phandle for this node */
(void)get_node_phandle(dt, node);
-
- /* add the symbol */
- for_each_label(node->labels, l) {
-
- s = xmalloc(sizeof(*s));
- s->label = l;
- s->node = node;
- s->next = NULL;
-
- /* add it to the symbols list */
- sp = &dt->symbols;
- while (*sp)
- sp = &((*sp)->next);
- *sp = s;
- }
}
NODE_WARNING(auto_label_phandles, NULL);

0 comments on commit cdd6692

Please sign in to comment.