Initialize tree pointers in the dump only option

The regulator, gpio, sensor and clock tree pointers were
initialized only during the display option and not during the
dump only option. This meant the dump option was not printing
any info previously. This patch fixes it by initilaizing the
tree pointers during the dump only option.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
diff --git a/gpio.c b/gpio.c
index d7df0e3..9f323eb 100644
--- a/gpio.c
+++ b/gpio.c
@@ -176,17 +176,6 @@
 	return tree_for_each(gpio_tree, dump_gpio_cb, NULL);
 }
 
-int gpio_dump(void)
-{
-	int ret;
-
-	printf("\nGpio Tree :\n");
-	printf("***********\n");
-	ret = dump_gpio_info();
-	printf("\n\n");
-
-	return ret;
-}
 
 static char *gpio_line(struct tree *t)
 {
@@ -325,6 +314,21 @@
 	return 0;
 }
 
+int gpio_dump(void)
+{
+	int ret;
+
+	if (gpio_load_info())
+		return -1;
+
+	printf("\nGpio Tree :\n");
+	printf("***********\n");
+	ret = dump_gpio_info();
+	printf("\n\n");
+
+	return ret;
+}
+
 static int gpio_display(bool refresh)
 {
 	if (gpio_load_info()) {