Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[pandora-kernel.git] / arch / ia64 / sn / pci / pcibr / pcibr_provider.c
index 2fac270..838c93c 100644 (file)
@@ -74,6 +74,22 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
        return (int)ret_stuff.v0;
 }
 
+u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus)
+{
+       s64 rc;
+       u16 ioboard;
+       nasid_t nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
+
+       rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard);
+       if (rc) {
+               printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
+                      rc);
+               return 0;
+       }
+
+       return ioboard;
+}
+
 /* 
  * PCI Bridge Error interrupt handler.  Gets invoked whenever a PCI 
  * bridge sends an error interrupt.
@@ -123,7 +139,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
         * register the bridge's error interrupt handler
         */
        if (request_irq(SGI_PCIASIC_ERROR, (void *)pcibr_error_intr_handler,
-                       SA_SHIRQ, "PCIBR error", (void *)(soft))) {
+                       IRQF_SHARED, "PCIBR error", (void *)(soft))) {
                printk(KERN_WARNING
                       "pcibr cannot allocate interrupt for error handler\n");
        }
@@ -163,9 +179,12 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
        /* Setup the PMU ATE map */
        soft->pbi_int_ate_resource.lowest_free_index = 0;
        soft->pbi_int_ate_resource.ate =
-           kmalloc(soft->pbi_int_ate_size * sizeof(u64), GFP_KERNEL);
-       memset(soft->pbi_int_ate_resource.ate, 0,
-              (soft->pbi_int_ate_size * sizeof(u64)));
+           kzalloc(soft->pbi_int_ate_size * sizeof(u64), GFP_KERNEL);
+
+       if (!soft->pbi_int_ate_resource.ate) {
+               kfree(soft);
+               return NULL;
+       }
 
        if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
                /* TIO PCI Bridge: find nearest node with CPUs */
@@ -252,3 +271,4 @@ pcibr_init_provider(void)
 
 EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable);
 EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable);
+EXPORT_SYMBOL_GPL(sn_ioboard_to_pci_bus);