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 /drivers | |
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 'drivers')
-rw-r--r-- | drivers/parisc/iosapic.c | 6 | ||||
-rw-r--r-- | drivers/xen/events.c | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 73348c4047e9..4a9cc92d4d18 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c | |||
@@ -702,7 +702,7 @@ static unsigned int iosapic_startup_irq(unsigned int irq) | |||
702 | } | 702 | } |
703 | 703 | ||
704 | #ifdef CONFIG_SMP | 704 | #ifdef CONFIG_SMP |
705 | static void iosapic_set_affinity_irq(unsigned int irq, | 705 | static int iosapic_set_affinity_irq(unsigned int irq, |
706 | const struct cpumask *dest) | 706 | const struct cpumask *dest) |
707 | { | 707 | { |
708 | struct vector_info *vi = iosapic_get_vector(irq); | 708 | struct vector_info *vi = iosapic_get_vector(irq); |
@@ -712,7 +712,7 @@ static void iosapic_set_affinity_irq(unsigned int irq, | |||
712 | 712 | ||
713 | dest_cpu = cpu_check_affinity(irq, dest); | 713 | dest_cpu = cpu_check_affinity(irq, dest); |
714 | if (dest_cpu < 0) | 714 | if (dest_cpu < 0) |
715 | return; | 715 | return -1; |
716 | 716 | ||
717 | cpumask_copy(irq_desc[irq].affinity, cpumask_of(dest_cpu)); | 717 | cpumask_copy(irq_desc[irq].affinity, cpumask_of(dest_cpu)); |
718 | vi->txn_addr = txn_affinity_addr(irq, dest_cpu); | 718 | vi->txn_addr = txn_affinity_addr(irq, dest_cpu); |
@@ -724,6 +724,8 @@ static void iosapic_set_affinity_irq(unsigned int irq, | |||
724 | iosapic_set_irt_data(vi, &dummy_d0, &d1); | 724 | iosapic_set_irt_data(vi, &dummy_d0, &d1); |
725 | iosapic_wr_irt_entry(vi, d0, d1); | 725 | iosapic_wr_irt_entry(vi, d0, d1); |
726 | spin_unlock_irqrestore(&iosapic_lock, flags); | 726 | spin_unlock_irqrestore(&iosapic_lock, flags); |
727 | |||
728 | return 0; | ||
727 | } | 729 | } |
728 | #endif | 730 | #endif |
729 | 731 | ||
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 30963af5dba0..33389880279b 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -688,13 +688,13 @@ void rebind_evtchn_irq(int evtchn, int irq) | |||
688 | } | 688 | } |
689 | 689 | ||
690 | /* Rebind an evtchn so that it gets delivered to a specific cpu */ | 690 | /* Rebind an evtchn so that it gets delivered to a specific cpu */ |
691 | static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu) | 691 | static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) |
692 | { | 692 | { |
693 | struct evtchn_bind_vcpu bind_vcpu; | 693 | struct evtchn_bind_vcpu bind_vcpu; |
694 | int evtchn = evtchn_from_irq(irq); | 694 | int evtchn = evtchn_from_irq(irq); |
695 | 695 | ||
696 | if (!VALID_EVTCHN(evtchn)) | 696 | if (!VALID_EVTCHN(evtchn)) |
697 | return; | 697 | return -1; |
698 | 698 | ||
699 | /* Send future instances of this interrupt to other vcpu. */ | 699 | /* Send future instances of this interrupt to other vcpu. */ |
700 | bind_vcpu.port = evtchn; | 700 | bind_vcpu.port = evtchn; |
@@ -707,13 +707,15 @@ static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu) | |||
707 | */ | 707 | */ |
708 | if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_vcpu, &bind_vcpu) >= 0) | 708 | if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_vcpu, &bind_vcpu) >= 0) |
709 | bind_evtchn_to_cpu(evtchn, tcpu); | 709 | bind_evtchn_to_cpu(evtchn, tcpu); |
710 | } | ||
711 | 710 | ||
711 | return 0; | ||
712 | } | ||
712 | 713 | ||
713 | static void set_affinity_irq(unsigned irq, const struct cpumask *dest) | 714 | static int set_affinity_irq(unsigned irq, const struct cpumask *dest) |
714 | { | 715 | { |
715 | unsigned tcpu = cpumask_first(dest); | 716 | unsigned tcpu = cpumask_first(dest); |
716 | rebind_irq_to_cpu(irq, tcpu); | 717 | |
718 | return rebind_irq_to_cpu(irq, tcpu); | ||
717 | } | 719 | } |
718 | 720 | ||
719 | int resend_irq_on_evtchn(unsigned int irq) | 721 | int resend_irq_on_evtchn(unsigned int irq) |