diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-04-04 14:20:32 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-04-04 14:20:32 +0200 |
commit | 4856aee6a85e50ce73a9d8a2b827766454faf033 (patch) | |
tree | 6f905e66c0aed5c51e512b6e9b44ce93e4252ad9 /drivers/gpio | |
parent | ab5f6c463ce740a555149c145171b3adc531c668 (diff) | |
parent | 6c370ee23010a441508ce91619ea0a7040251090 (diff) | |
download | barebox-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.c | 11 |
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) { |