summaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-02-18 16:43:33 +0000
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-03-10 14:44:41 -0500
commit8135591e90c81462a6902f6ffa1f1ca021db077a (patch)
treefe56b7166bc9a7bfd6e3d0edf1021878e439726a /drivers/xen
parentbf480d952bcf25e8ff7e95d2a23964107513ac51 (diff)
downloadop-kernel-dev-8135591e90c81462a6902f6ffa1f1ca021db077a.zip
op-kernel-dev-8135591e90c81462a6902f6ffa1f1ca021db077a.tar.gz
xen: events: refactor xen_create_msi_irq slightly
Calling PHYSDEVOP_map_pirq earlier simplifies error handling and starts to make the tail end of this function look like xen_bind_pirq_msi_to_irq. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 1033f62..b54285e 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -716,6 +716,12 @@ int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type)
map_irq.entry_nr = msidesc->msi_attrib.entry_nr;
}
+ rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
+ if (rc) {
+ dev_warn(&dev->dev, "xen map irq failed %d\n", rc);
+ goto out;
+ }
+
spin_lock(&irq_mapping_update_lock);
irq = xen_allocate_irq_dynamic();
@@ -723,15 +729,6 @@ int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type)
if (irq == -1)
goto out;
- rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
- if (rc) {
- printk(KERN_WARNING "xen map irq failed %d\n", rc);
-
- xen_free_irq(irq);
-
- irq = -1;
- goto out;
- }
irq_info[irq] = mk_pirq_info(0, map_irq.pirq, 0, map_irq.index);
set_irq_chip_and_handler_name(irq, &xen_pirq_chip,
OpenPOWER on IntegriCloud