return __pseries_msi_allocate_domains(phb, count);
 }
 
+void pseries_msi_free_domains(struct pci_controller *phb)
+{
+       if (phb->msi_domain)
+               irq_domain_remove(phb->msi_domain);
+       if (phb->dev_domain)
+               irq_domain_remove(phb->dev_domain);
+       if (phb->fwnode)
+               irq_domain_free_fwnode(phb->fwnode);
+}
+
 static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
 {
        /* No LSI -> leave MSIs (if any) configured */
 
 
        pci_devs_phb_init_dynamic(phb);
 
+       pseries_msi_allocate_domains(phb);
+
        /* Create EEH devices for the PHB */
        eeh_phb_pe_create(phb);
 
                }
        }
 
+       pseries_msi_free_domains(phb);
+
        /* Remove the PCI bus and unregister the bridge device from sysfs */
        phb->bus = NULL;
        pci_remove_bus(b);
 
 
 extern struct pci_controller_ops pseries_pci_controller_ops;
 int pseries_msi_allocate_domains(struct pci_controller *phb);
+void pseries_msi_free_domains(struct pci_controller *phb);
 
 unsigned long pseries_memory_block_size(void);