bootstd: Move the bootflow list into an alist

Use an alist for this data structure as it is somewhat simpler to
manage. This means that bootstd holds a simple list of bootflow structs
and can drop it at will, without chasing down lists.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/bootdev.c b/cmd/bootdev.c
index fa7285b..4bc229e 100644
--- a/cmd/bootdev.c
+++ b/cmd/bootdev.c
@@ -81,7 +81,7 @@
 
 	dev = priv->cur_bootdev;
 
-	/* Count the number of bootflows, including how many are valid*/
+	/* Count the number of bootflows, including how many are valid */
 	num_valid = 0;
 	for (ret = bootdev_first_bootflow(dev, &bflow), i = 0;
 	     !ret;
diff --git a/cmd/bootflow.c b/cmd/bootflow.c
index 1c1146c..f88995a 100644
--- a/cmd/bootflow.c
+++ b/cmd/bootflow.c
@@ -208,7 +208,7 @@
 		if (!ret)
 			num_valid++;
 		ret = bootstd_add_bootflow(&bflow);
-		if (ret) {
+		if (ret < 0) {
 			printf("Out of memory\n");
 			return CMD_RET_FAILURE;
 		}