diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-14 16:06:54 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-16 08:11:22 -0500 |
commit | a8db8cf0d894df5f1dcfd4bce9894e0dbcc01c96 (patch) | |
tree | f9f2c53c57eeb04e5df60671951bcf4f2ca4966e /arch/powerpc/platforms/wsp | |
parent | 68700650e71b6bb6636673f4f9c8ec807353d8d6 (diff) |
irq_domain: Replace irq_alloc_host() with revmap-specific initializers
Each revmap type has different arguments for setting up the revmap.
This patch splits up the generator functions so that each revmap type
can do its own setup and the user doesn't need to keep track of how
each revmap type handles the arguments.
This patch also adds a host_data argument to the generators. There are
cases where the host_data pointer will be needed before the function returns.
ie. the legacy map calls the .map callback for each irq before returning.
v2: - Add void *host_data argument to irq_domain_add_*() functions
- fixed failure to compile
- Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/powerpc/platforms/wsp')
-rw-r--r-- | arch/powerpc/platforms/wsp/opb_pic.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/wsp/opb_pic.c b/arch/powerpc/platforms/wsp/opb_pic.c index 76b33bc36116..4837515c2826 100644 --- a/arch/powerpc/platforms/wsp/opb_pic.c +++ b/arch/powerpc/platforms/wsp/opb_pic.c | |||
@@ -263,13 +263,11 @@ struct opb_pic *opb_pic_init_one(struct device_node *dn) | |||
263 | goto free_opb; | 263 | goto free_opb; |
264 | } | 264 | } |
265 | 265 | ||
266 | /* Allocate an irq host so that Linux knows that despite only | 266 | /* Allocate an irq domain so that Linux knows that despite only |
267 | * having one interrupt to issue, we're the controller for multiple | 267 | * having one interrupt to issue, we're the controller for multiple |
268 | * hardware IRQs, so later we can lookup their virtual IRQs. */ | 268 | * hardware IRQs, so later we can lookup their virtual IRQs. */ |
269 | 269 | ||
270 | opb->host = irq_alloc_host(dn, IRQ_DOMAIN_MAP_LINEAR, | 270 | opb->host = irq_domain_add_linear(dn, OPB_NR_IRQS, &opb_host_ops, opb); |
271 | OPB_NR_IRQS, &opb_host_ops, -1); | ||
272 | |||
273 | if (!opb->host) { | 271 | if (!opb->host) { |
274 | printk(KERN_ERR "opb: Failed to allocate IRQ host!\n"); | 272 | printk(KERN_ERR "opb: Failed to allocate IRQ host!\n"); |
275 | goto free_regs; | 273 | goto free_regs; |
@@ -277,7 +275,6 @@ struct opb_pic *opb_pic_init_one(struct device_node *dn) | |||
277 | 275 | ||
278 | opb->index = opb_index++; | 276 | opb->index = opb_index++; |
279 | spin_lock_init(&opb->lock); | 277 | spin_lock_init(&opb->lock); |
280 | opb->host->host_data = opb; | ||
281 | 278 | ||
282 | /* Disable all interrupts by default */ | 279 | /* Disable all interrupts by default */ |
283 | opb_out(opb, OPB_MLSASIER, 0); | 280 | opb_out(opb, OPB_MLSASIER, 0); |