From 4aa78264d14bb0e87897acb90941c368248e20ce Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Fri, 19 Jun 2009 22:56:09 +0200 Subject: [ARM] pxa: use kzalloc() in pxa_init_gpio_chip() As slab is available early now, use kzalloc() rather than alloc_bootmem_low() in pxa_init_gpio_chip(). This removes the following boot time warning: <4>------------[ cut here ]------------ <4>WARNING: at mm/bootmem.c:535 alloc_arch_preferred_bootmem+0x2c/0x54() Modules linked in: [] (unwind_backtrace+0x0/0xdc) from [] (warn_slowpath_common+0x4c/0x80) [] (warn_slowpath_common+0x4c/0x80) from [] (alloc_arch_preferred_bootmem+0x2c/0x54) [] (alloc_arch_preferred_bootmem+0x2c/0x54) from [] (___alloc_bootmem_nopanic+0x34/0xd0) [] (___alloc_bootmem_nopanic+0x34/0xd0) from [] (___alloc_bootmem+0xc/0x34) [] (___alloc_bootmem+0xc/0x34) from [] (pxa_init_gpio+0x48/0x228) [] (pxa_init_gpio+0x48/0x228) from [] (init_IRQ+0x34/0x44) [] (init_IRQ+0x34/0x44) from [] (start_kernel+0x144/0x264) [] (start_kernel+0x144/0x264) from [] (0xa0008034) <4>---[ end trace 1b75b31a2719ed1c ]--- Signed-off-by: Daniel Mack Signed-off-by: Eric Miao --- arch/arm/plat-pxa/gpio.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'arch/arm/plat-pxa') diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c index abc79d44acaa..98548c6903a0 100644 --- a/arch/arm/plat-pxa/gpio.c +++ b/arch/arm/plat-pxa/gpio.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include @@ -112,17 +112,12 @@ static int __init pxa_init_gpio_chip(int gpio_end) int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1; struct pxa_gpio_chip *chips; - /* this is early, we have to use bootmem allocator, and we really - * want this to be allocated dynamically for different 'gpio_end' - */ - chips = alloc_bootmem_low(nbanks * sizeof(struct pxa_gpio_chip)); + chips = kzalloc(nbanks * sizeof(struct pxa_gpio_chip), GFP_KERNEL); if (chips == NULL) { pr_err("%s: failed to allocate GPIO chips\n", __func__); return -ENOMEM; } - memset(chips, 0, nbanks * sizeof(struct pxa_gpio_chip)); - for (i = 0, gpio = 0; i < nbanks; i++, gpio += 32) { struct gpio_chip *c = &chips[i].chip; -- cgit v1.2.3