aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-06-09 09:49:13 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-07-11 13:19:30 -0400
commita0ee05670915006564962114d4211dd578a8b28a (patch)
treed2c2d6599f32af66c9606fb67f31824956f6c0f9
parented89eb6396b3307bf9aaa4785f6a0914a68040cf (diff)
xen/pci: Squash pci_xen_initial_domain and xen_setup_pirqs together.
Since they are only called once and the rest of the pci_xen_* functions follow the same pattern of setup. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r--arch/x86/include/asm/xen/pci.h5
-rw-r--r--arch/x86/pci/xen.c17
-rw-r--r--drivers/xen/events.c2
3 files changed, 10 insertions, 14 deletions
diff --git a/arch/x86/include/asm/xen/pci.h b/arch/x86/include/asm/xen/pci.h
index 4fbda9a3f339..968d57dd54c9 100644
--- a/arch/x86/include/asm/xen/pci.h
+++ b/arch/x86/include/asm/xen/pci.h
@@ -14,13 +14,14 @@ static inline int pci_xen_hvm_init(void)
14} 14}
15#endif 15#endif
16#if defined(CONFIG_XEN_DOM0) 16#if defined(CONFIG_XEN_DOM0)
17void __init xen_setup_pirqs(void); 17int __init pci_xen_initial_domain(void);
18int xen_find_device_domain_owner(struct pci_dev *dev); 18int xen_find_device_domain_owner(struct pci_dev *dev);
19int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain); 19int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
20int xen_unregister_device_domain_owner(struct pci_dev *dev); 20int xen_unregister_device_domain_owner(struct pci_dev *dev);
21#else 21#else
22static inline void __init xen_setup_pirqs(void) 22static inline int __init pci_xen_initial_domain(void)
23{ 23{
24 return -1;
24} 25}
25static inline int xen_find_device_domain_owner(struct pci_dev *dev) 26static inline int xen_find_device_domain_owner(struct pci_dev *dev)
26{ 27{
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 55c8cc3647a7..54d5f3131060 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -429,8 +429,11 @@ static __init void xen_setup_acpi_sci(void)
429 return; 429 return;
430} 430}
431#endif 431#endif
432static int __init pci_xen_initial_domain(void) 432
433int __init pci_xen_initial_domain(void)
433{ 434{
435 int pirq, irq;
436
434#ifdef CONFIG_PCI_MSI 437#ifdef CONFIG_PCI_MSI
435 x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs; 438 x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs;
436 x86_msi.teardown_msi_irq = xen_teardown_msi_irq; 439 x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
@@ -439,15 +442,6 @@ static int __init pci_xen_initial_domain(void)
439 xen_setup_acpi_sci(); 442 xen_setup_acpi_sci();
440 __acpi_register_gsi = acpi_register_gsi_xen; 443 __acpi_register_gsi = acpi_register_gsi_xen;
441#endif 444#endif
442 return 0;
443}
444
445void __init xen_setup_pirqs(void)
446{
447 int pirq, irq;
448
449 pci_xen_initial_domain();
450
451 if (0 == nr_ioapics) { 445 if (0 == nr_ioapics) {
452 for (irq = 0; irq < NR_IRQS_LEGACY; irq++) { 446 for (irq = 0; irq < NR_IRQS_LEGACY; irq++) {
453 pirq = xen_allocate_pirq_gsi(irq); 447 pirq = xen_allocate_pirq_gsi(irq);
@@ -456,7 +450,7 @@ void __init xen_setup_pirqs(void)
456 break; 450 break;
457 irq = xen_bind_pirq_gsi_to_irq(irq, pirq, 0, "xt-pic"); 451 irq = xen_bind_pirq_gsi_to_irq(irq, pirq, 0, "xt-pic");
458 } 452 }
459 return; 453 return 0;
460 } 454 }
461#ifdef CONFIG_ACPI 455#ifdef CONFIG_ACPI
462 /* Pre-allocate legacy irqs */ 456 /* Pre-allocate legacy irqs */
@@ -471,6 +465,7 @@ void __init xen_setup_pirqs(void)
471 true /* allocate IRQ */); 465 true /* allocate IRQ */);
472 } 466 }
473#endif 467#endif
468 return 0;
474} 469}
475 470
476struct xen_device_domain_owner { 471struct xen_device_domain_owner {
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 30df85d8fca8..23f1b8166a2a 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -1693,6 +1693,6 @@ void __init xen_init_IRQ(void)
1693 } else { 1693 } else {
1694 irq_ctx_init(smp_processor_id()); 1694 irq_ctx_init(smp_processor_id());
1695 if (xen_initial_domain()) 1695 if (xen_initial_domain())
1696 xen_setup_pirqs(); 1696 pci_xen_initial_domain();
1697 } 1697 }
1698} 1698}