libfdt: Rename and publish _fdt_next_tag()

Although it's a low-level function that shouldn't normally be needed,
there are circumstances where it's useful for users of libfdt to use
the _fdt_next_tag() function.  Therefore, this patch renames it to
fdt_next_tag() and publishes it in libfdt.h.

In addition, this patch adds a new testcase using fdt_next_tag(),
dtbs_equal_ordered.  This testcase tests for structural equality of
two dtbs, including the order of properties and subnodes, but ignoring
NOP tags, the order of the dtb sections and the layout of strings in
the strings block.  This will be useful for testing other dtc
functionality in the future.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index bb7a2b7..485b39d 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -224,7 +224,7 @@
 	int namestroff;
 	int err;
 
-	tag = _fdt_next_tag(fdt, nodeoffset, &nextoffset);
+	tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
 	if (tag != FDT_BEGIN_NODE)
 		return -FDT_ERR_BADOFFSET;
 
@@ -298,10 +298,10 @@
 		return offset;
 
 	/* Try to place the new node after the parent's properties */
-	_fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+	fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
 	do {
 		offset = nextoffset;
-		tag = _fdt_next_tag(fdt, offset, &nextoffset);
+		tag = fdt_next_tag(fdt, offset, &nextoffset);
 	} while (tag == FDT_PROP);
 
 	nh = _fdt_offset_ptr_w(fdt, offset);