diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-04-27 20:59:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-28 06:21:16 -0400 |
commit | d5dedd4507d307eb3f35f21b6e16f336fdc0d82a (patch) | |
tree | 2c31b00395bde49ec4c5a415b081daaec44d3dab /arch/powerpc | |
parent | fcef5911c7ea89b80d5bfc727f402f37c9eefd57 (diff) |
irq: change ->set_affinity() to return status
according to Ingo, change set_affinity() in irq_chip should return int,
because that way we can handle failure cases in a much cleaner way, in
the genirq layer.
v2: fix two typos
[ Impact: extend API ]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-arch@vger.kernel.org
LKML-Reference: <49F654E9.4070809@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/pseries/xics.c | 12 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index 80b513449f4c..be3581a8c294 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c | |||
@@ -333,7 +333,7 @@ static void xics_eoi_lpar(unsigned int virq) | |||
333 | lpar_xirr_info_set((0xff << 24) | irq); | 333 | lpar_xirr_info_set((0xff << 24) | irq); |
334 | } | 334 | } |
335 | 335 | ||
336 | static void xics_set_affinity(unsigned int virq, const struct cpumask *cpumask) | 336 | static int xics_set_affinity(unsigned int virq, const struct cpumask *cpumask) |
337 | { | 337 | { |
338 | unsigned int irq; | 338 | unsigned int irq; |
339 | int status; | 339 | int status; |
@@ -342,14 +342,14 @@ static void xics_set_affinity(unsigned int virq, const struct cpumask *cpumask) | |||
342 | 342 | ||
343 | irq = (unsigned int)irq_map[virq].hwirq; | 343 | irq = (unsigned int)irq_map[virq].hwirq; |
344 | if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) | 344 | if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) |
345 | return; | 345 | return -1; |
346 | 346 | ||
347 | status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); | 347 | status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); |
348 | 348 | ||
349 | if (status) { | 349 | if (status) { |
350 | printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n", | 350 | printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n", |
351 | __func__, irq, status); | 351 | __func__, irq, status); |
352 | return; | 352 | return -1; |
353 | } | 353 | } |
354 | 354 | ||
355 | /* | 355 | /* |
@@ -363,7 +363,7 @@ static void xics_set_affinity(unsigned int virq, const struct cpumask *cpumask) | |||
363 | printk(KERN_WARNING | 363 | printk(KERN_WARNING |
364 | "%s: No online cpus in the mask %s for irq %d\n", | 364 | "%s: No online cpus in the mask %s for irq %d\n", |
365 | __func__, cpulist, virq); | 365 | __func__, cpulist, virq); |
366 | return; | 366 | return -1; |
367 | } | 367 | } |
368 | 368 | ||
369 | status = rtas_call(ibm_set_xive, 3, 1, NULL, | 369 | status = rtas_call(ibm_set_xive, 3, 1, NULL, |
@@ -372,8 +372,10 @@ static void xics_set_affinity(unsigned int virq, const struct cpumask *cpumask) | |||
372 | if (status) { | 372 | if (status) { |
373 | printk(KERN_ERR "%s: ibm,set-xive irq=%u returns %d\n", | 373 | printk(KERN_ERR "%s: ibm,set-xive irq=%u returns %d\n", |
374 | __func__, irq, status); | 374 | __func__, irq, status); |
375 | return; | 375 | return -1; |
376 | } | 376 | } |
377 | |||
378 | return 0; | ||
377 | } | 379 | } |
378 | 380 | ||
379 | static struct irq_chip xics_pic_direct = { | 381 | static struct irq_chip xics_pic_direct = { |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 21b956701596..f4cbd15cf22f 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -807,7 +807,7 @@ static void mpic_end_ipi(unsigned int irq) | |||
807 | 807 | ||
808 | #endif /* CONFIG_SMP */ | 808 | #endif /* CONFIG_SMP */ |
809 | 809 | ||
810 | void mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask) | 810 | int mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask) |
811 | { | 811 | { |
812 | struct mpic *mpic = mpic_from_irq(irq); | 812 | struct mpic *mpic = mpic_from_irq(irq); |
813 | unsigned int src = mpic_irq_to_hw(irq); | 813 | unsigned int src = mpic_irq_to_hw(irq); |
@@ -824,6 +824,8 @@ void mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask) | |||
824 | mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION), | 824 | mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION), |
825 | mpic_physmask(cpus_addr(tmp)[0])); | 825 | mpic_physmask(cpus_addr(tmp)[0])); |
826 | } | 826 | } |
827 | |||
828 | return 0; | ||
827 | } | 829 | } |
828 | 830 | ||
829 | static unsigned int mpic_type_to_vecpri(struct mpic *mpic, unsigned int type) | 831 | static unsigned int mpic_type_to_vecpri(struct mpic *mpic, unsigned int type) |