summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpio/gpio.c b/drivers/gpio/gpio.c
index 6d29224f98..6398268eae 100644
--- a/drivers/gpio/gpio.c
+++ b/drivers/gpio/gpio.c
@@ -1,3 +1,4 @@
+#include <init.h>
#include <common.h>
#include <command.h>
#include <complete.h>
@@ -13,7 +14,15 @@ struct gpio_info {
char *label;
};
-static struct gpio_info gpio_desc[ARCH_NR_GPIOS];
+static struct gpio_info *gpio_desc;
+
+static int gpio_desc_alloc(void)
+{
+ gpio_desc = xzalloc(sizeof(struct gpio_info) * ARCH_NR_GPIOS);
+
+ return 0;
+}
+pure_initcall(gpio_desc_alloc);
static int gpio_ensure_requested(struct gpio_info *gi, int gpio)
{