summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-04-04 14:20:32 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-04-04 14:20:32 +0200
commit4856aee6a85e50ce73a9d8a2b827766454faf033 (patch)
tree6f905e66c0aed5c51e512b6e9b44ce93e4252ad9 /drivers/gpio
parentab5f6c463ce740a555149c145171b3adc531c668 (diff)
parent6c370ee23010a441508ce91619ea0a7040251090 (diff)
downloadbarebox-4856aee6a85e50ce73a9d8a2b827766454faf033.tar.gz
barebox-4856aee6a85e50ce73a9d8a2b827766454faf033.tar.xz
Merge branch 'for-next/malloc-all-initcalls'
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)
{