summaryrefslogtreecommitdiff
path: root/dtc-parser.y
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-11-22 14:39:23 +1100
committerJon Loeliger <jdl@freescale.com>2007-11-26 16:00:19 -0600
commitdc941774e228779562379a221ddc489d289e8513 (patch)
treee90a244560f8ca8e1ffd8393f3c3ab74e420d37a /dtc-parser.y
parentb16a2bd89dbf109b9c8d1c9e047b9afa72af6d2f (diff)
downloaddtc-dc941774e228779562379a221ddc489d289e8513.tar.gz
dtc: Merge refs and labels into single "markers" list (v2)
Currently, every 'data' object, used to represent property values, has two lists of fixup structures - one for labels and one for references. Sometimes we want to look at them separately, but other times we need to consider both types of fixup. I'm planning to implement string references, where a full path rather than a phandle is substituted into a property value. Adding yet another list of fixups for that would start to get silly. So, this patch merges the "refs" and "labels" lists into a single list of "markers", each of which has a type field indicating if it represents a label or a phandle reference. String references or any other new type of in-data marker will then just need a new type value - merging data blocks and other common manipulations will just work. While I was at it I made some cleanups to the handling of fixups which simplify things further. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r--dtc-parser.y11
1 files changed, 6 insertions, 5 deletions
diff --git a/dtc-parser.y b/dtc-parser.y
index d998bfe..2407af4 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -194,7 +194,7 @@ propdata:
}
| propdata DT_LABEL
{
- $$ = data_add_label($1, $2);
+ $$ = data_add_marker($1, LABEL, $2);
}
;
@@ -209,7 +209,7 @@ propdataprefix:
}
| propdataprefix DT_LABEL
{
- $$ = data_add_label($1, $2);
+ $$ = data_add_marker($1, LABEL, $2);
}
;
@@ -224,11 +224,12 @@ celllist:
}
| celllist DT_REF
{
- $$ = data_append_cell(data_add_fixup($1, $2), -1);
+ $$ = data_append_cell(data_add_marker($1, REF_PHANDLE,
+ $2), -1);
}
| celllist DT_LABEL
{
- $$ = data_add_label($1, $2);
+ $$ = data_add_marker($1, LABEL, $2);
}
;
@@ -262,7 +263,7 @@ bytestring:
}
| bytestring DT_LABEL
{
- $$ = data_add_label($1, $2);
+ $$ = data_add_marker($1, LABEL, $2);
}
;