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>
This commit is contained in:
@@ -688,13 +688,13 @@ void rebind_evtchn_irq(int evtchn, int irq)
|
||||
}
|
||||
|
||||
/* Rebind an evtchn so that it gets delivered to a specific cpu */
|
||||
static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
|
||||
static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
|
||||
{
|
||||
struct evtchn_bind_vcpu bind_vcpu;
|
||||
int evtchn = evtchn_from_irq(irq);
|
||||
|
||||
if (!VALID_EVTCHN(evtchn))
|
||||
return;
|
||||
return -1;
|
||||
|
||||
/* Send future instances of this interrupt to other vcpu. */
|
||||
bind_vcpu.port = evtchn;
|
||||
@@ -707,13 +707,15 @@ static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
|
||||
*/
|
||||
if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_vcpu, &bind_vcpu) >= 0)
|
||||
bind_evtchn_to_cpu(evtchn, tcpu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void set_affinity_irq(unsigned irq, const struct cpumask *dest)
|
||||
static int set_affinity_irq(unsigned irq, const struct cpumask *dest)
|
||||
{
|
||||
unsigned tcpu = cpumask_first(dest);
|
||||
rebind_irq_to_cpu(irq, tcpu);
|
||||
|
||||
return rebind_irq_to_cpu(irq, tcpu);
|
||||
}
|
||||
|
||||
int resend_irq_on_evtchn(unsigned int irq)
|
||||
|
Reference in New Issue
Block a user