Skip to content

Commit e9a3bfe

Browse files
committed
scripts/dtc: Revert "yamltree: Ensure consistent bracketing of properties with phandles"
This reverts upstream commit 18d7b2f4ee45fec422b7d82bab0b3c762ee907e4. A revert in upstream dtc is pending. This commit didn't work for properties such as 'interrupt-map' that have phandle in the middle of an entry. It would also not work for a 0 or -1 phandle value that acts as a NULL. Signed-off-by: Rob Herring <[email protected]>
1 parent dabf6b3 commit e9a3bfe

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

scripts/dtc/yamltree.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,27 +138,6 @@ static void yaml_propval(yaml_emitter_t *emitter, struct property *prop)
138138
(yaml_char_t *)YAML_SEQ_TAG, 1, YAML_FLOW_SEQUENCE_STYLE);
139139
yaml_emitter_emit_or_die(emitter, &event);
140140

141-
/* Ensure we have a type marker before any phandle */
142-
for_each_marker(m) {
143-
int last_offset = 0;
144-
struct marker *type_m;
145-
146-
if (m->type >= TYPE_UINT8)
147-
last_offset = m->offset;
148-
149-
if (!(m->next && m->next->type == REF_PHANDLE &&
150-
last_offset < m->next->offset))
151-
continue;
152-
153-
type_m = xmalloc(sizeof(*type_m));
154-
type_m->offset = m->next->offset;
155-
type_m->type = TYPE_UINT32;
156-
type_m->ref = NULL;
157-
type_m->next = m->next;
158-
m->next = type_m;
159-
}
160-
161-
m = prop->val.markers;
162141
for_each_marker(m) {
163142
int chunk_len;
164143
char *data = &prop->val.val[m->offset];

0 commit comments

Comments
 (0)