aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-02-18 11:43:29 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-03-10 14:44:37 -0500
commit4b41df7f6e0b5684378d9155773c42a4577e8582 (patch)
tree9ef8bf6d42bb2c04d2a7a9ef3f0c7dd1f9b4861d /drivers
parentbb5d079aefa828c292c267ed34ed2282947fa233 (diff)
xen: events: return irq from xen_allocate_pirq_msi
consistent with other similar functions. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/events.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 36e9adcdebe9..ed3420df0937 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -664,31 +664,34 @@ static int find_unbound_pirq(int type)
664 return -1; 664 return -1;
665} 665}
666 666
667void xen_allocate_pirq_msi(char *name, int *irq, int *pirq, int alloc_pirq) 667int xen_allocate_pirq_msi(char *name, int *pirq, int alloc_pirq)
668{ 668{
669 int irq;
670
669 spin_lock(&irq_mapping_update_lock); 671 spin_lock(&irq_mapping_update_lock);
670 672
671 *irq = xen_allocate_irq_dynamic(); 673 irq = xen_allocate_irq_dynamic();
672 if (*irq == -1) 674 if (irq == -1)
673 goto out; 675 goto out;
674 676
675 if (alloc_pirq) { 677 if (alloc_pirq) {
676 *pirq = find_unbound_pirq(MAP_PIRQ_TYPE_MSI); 678 *pirq = find_unbound_pirq(MAP_PIRQ_TYPE_MSI);
677 if (*pirq == -1) { 679 if (*pirq == -1) {
678 xen_free_irq(*irq); 680 xen_free_irq(irq);
679 *irq = -1; 681 irq = -1;
680 goto out; 682 goto out;
681 } 683 }
682 } 684 }
683 685
684 set_irq_chip_and_handler_name(*irq, &xen_pirq_chip, 686 set_irq_chip_and_handler_name(irq, &xen_pirq_chip,
685 handle_level_irq, name); 687 handle_level_irq, name);
686 688
687 irq_info[*irq] = mk_pirq_info(0, *pirq, 0, 0); 689 irq_info[irq] = mk_pirq_info(0, *pirq, 0, 0);
688 pirq_to_irq[*pirq] = *irq; 690 pirq_to_irq[*pirq] = irq;
689 691
690out: 692out:
691 spin_unlock(&irq_mapping_update_lock); 693 spin_unlock(&irq_mapping_update_lock);
694 return irq;
692} 695}
693 696
694int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type) 697int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type)