diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-10-01 23:37:53 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-02 21:48:44 -0400 |
commit | 5669c3cf19fbadaa9120b59914beec8431277efe (patch) | |
tree | 463ead47019486cdbde965ce1ef17045b32ca73f /arch/powerpc/kernel/irq.c | |
parent | 88de3cab98ff6c794b840969427e61605d0cc1ea (diff) |
[POWERPC] Limit range of __init_ref_ok somewhat
This patch introduces zalloc_maybe_bootmem and uses it so that we don't
have to mark a whole (largish) routine as __init_ref_ok.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/irq.c')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 0e47c8cfc979..151b13119208 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -424,7 +424,7 @@ static int default_irq_host_match(struct irq_host *h, struct device_node *np) | |||
424 | return h->of_node != NULL && h->of_node == np; | 424 | return h->of_node != NULL && h->of_node == np; |
425 | } | 425 | } |
426 | 426 | ||
427 | __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node, | 427 | struct irq_host *irq_alloc_host(struct device_node *of_node, |
428 | unsigned int revmap_type, | 428 | unsigned int revmap_type, |
429 | unsigned int revmap_arg, | 429 | unsigned int revmap_arg, |
430 | struct irq_host_ops *ops, | 430 | struct irq_host_ops *ops, |
@@ -439,13 +439,7 @@ __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node, | |||
439 | /* Allocate structure and revmap table if using linear mapping */ | 439 | /* Allocate structure and revmap table if using linear mapping */ |
440 | if (revmap_type == IRQ_HOST_MAP_LINEAR) | 440 | if (revmap_type == IRQ_HOST_MAP_LINEAR) |
441 | size += revmap_arg * sizeof(unsigned int); | 441 | size += revmap_arg * sizeof(unsigned int); |
442 | if (mem_init_done) | 442 | host = zalloc_maybe_bootmem(size, GFP_KERNEL); |
443 | host = kzalloc(size, GFP_KERNEL); | ||
444 | else { | ||
445 | host = alloc_bootmem(size); | ||
446 | if (host) | ||
447 | memset(host, 0, size); | ||
448 | } | ||
449 | if (host == NULL) | 443 | if (host == NULL) |
450 | return NULL; | 444 | return NULL; |
451 | 445 | ||