dm: part: Convert partition API use to linker lists

We can use linker lists instead of explicitly declaring each function.
This makes the code shorter by avoiding switch() statements and lots of
header file declarations.

While this does clean up the code it introduces a few code issues with SPL.
SPL never needs to print partition information since this all happens from
commands. SPL mostly doesn't need to obtain information about a partition
either, except in a few cases. Add these cases so that the code will be
dropped from each partition driver when not needed. This avoids code bloat.

I think this is still a win, since it is not a bad thing to be explicit
about which features are used in SPL. But others may like to weigh in.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
diff --git a/disk/part_iso.c b/disk/part_iso.c
index 2984df5..1d72d23 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -217,14 +217,13 @@
 	return 0;
 }
 
-int get_partition_info_iso(struct blk_desc *dev_desc, int part_num,
-			   disk_partition_t *info)
+static int get_partition_info_iso(struct blk_desc *dev_desc, int part_num,
+				  disk_partition_t *info)
 {
 	return(get_partition_info_iso_verb(dev_desc, part_num, info, 1));
 }
 
-
-void print_part_iso(struct blk_desc *dev_desc)
+static void print_part_iso(struct blk_desc *dev_desc)
 {
 	disk_partition_t info;
 	int i;
@@ -241,11 +240,18 @@
 	} while (get_partition_info_iso_verb(dev_desc,i,&info,0)!=-1);
 }
 
-int test_part_iso(struct blk_desc *dev_desc)
+static int test_part_iso(struct blk_desc *dev_desc)
 {
 	disk_partition_t info;
 
 	return(get_partition_info_iso_verb(dev_desc,0,&info,0));
 }
 
+U_BOOT_PART_TYPE(iso) = {
+	.name		= "ISO",
+	.part_type	= PART_TYPE_ISO,
+	.get_info	= get_partition_info_iso,
+	.print		= print_part_iso,
+	.test		= test_part_iso,
+};
 #endif