summaryrefslogtreecommitdiff
path: root/drivers/xen/events.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-05-27 02:31:24 +0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-27 12:11:37 +0400
commit0f2287ad7c61f10b2a22a06e2a66cdbbbfc44ad0 (patch)
treec3844837fdcdb1ab2c3dbea3b9cc9695b5aa7143 /drivers/xen/events.c
parenteb1e305f4ef201e549ffd475b7dcbcd4ec36d7dc (diff)
downloadlinux-0f2287ad7c61f10b2a22a06e2a66cdbbbfc44ad0.tar.xz
xen: fix unbind_from_irq()
Rearrange the tests in unbind_from_irq() so that we can still unbind an irq even if the underlying event channel is bad. This allows a device driver to shuffle its irqs on save/restore before the underlying event channels have been fixed up. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r--drivers/xen/events.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index f64e9798129c..70375a690761 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -355,7 +355,7 @@ static void unbind_from_irq(unsigned int irq)
spin_lock(&irq_mapping_update_lock);
- if (VALID_EVTCHN(evtchn) && (--irq_bindcount[irq] == 0)) {
+ if ((--irq_bindcount[irq] == 0) && VALID_EVTCHN(evtchn)) {
close.port = evtchn;
if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
BUG();
@@ -375,7 +375,7 @@ static void unbind_from_irq(unsigned int irq)
evtchn_to_irq[evtchn] = -1;
irq_info[irq] = IRQ_UNBOUND;
- dynamic_irq_init(irq);
+ dynamic_irq_cleanup(irq);
}
spin_unlock(&irq_mapping_update_lock);