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>
diff --git a/checks.c b/checks.c
index c8a099e..cacb5b4 100644
--- a/checks.c
+++ b/checks.c
@@ -243,26 +243,22 @@
 static void fixup_phandle_references(struct check *c, struct node *dt,
 				     struct node *node, struct property *prop)
 {
-      struct fixup *f = prop->val.refs;
+      struct marker *m = prop->val.markers;
       struct node *refnode;
       cell_t phandle;
 
-      while (f) {
-	      assert(f->offset + sizeof(cell_t) <= prop->val.len);
+      for_each_marker_of_type(m, REF_PHANDLE) {
+	      assert(m->offset + sizeof(cell_t) <= prop->val.len);
 
-	      refnode = get_node_by_ref(dt, f->ref);
+	      refnode = get_node_by_ref(dt, m->ref);
 	      if (! refnode) {
 		      FAIL(c, "Reference to non-existent node or label \"%s\"\n",
-			   f->ref);
-	      } else {
-		      phandle = get_node_phandle(dt, refnode);
-
-		      *((cell_t *)(prop->val.val + f->offset)) = cpu_to_be32(phandle);
+			   m->ref);
+		      continue;
 	      }
 
-              prop->val.refs = f->next;
-              fixup_free(f);
-              f = prop->val.refs;
+	      phandle = get_node_phandle(dt, refnode);
+	      *((cell_t *)(prop->val.val + m->offset)) = cpu_to_be32(phandle);
       }
 }
 CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR,