]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/s390/pci/pci.c
s390/pci: s390 specific PCI sysfs attributes
[mirror_ubuntu-artful-kernel.git] / arch / s390 / pci / pci.c
index 5a2ef9e75c974c58cca0d816a5d6f74c57556ae6..0723b1077a647b2a9af782fee1ab74ad941ae5b7 100644 (file)
 
 /* list of all detected zpci devices */
 LIST_HEAD(zpci_list);
+EXPORT_SYMBOL_GPL(zpci_list);
 DEFINE_MUTEX(zpci_list_lock);
+EXPORT_SYMBOL_GPL(zpci_list_lock);
+
+struct pci_hp_callback_ops hotplug_ops;
+EXPORT_SYMBOL_GPL(hotplug_ops);
 
 static DECLARE_BITMAP(zpci_domain, ZPCI_NR_DEVICES);
 static DEFINE_SPINLOCK(zpci_domain_lock);
@@ -623,6 +628,7 @@ static void zpci_remove_device(struct pci_dev *pdev)
        dev_info(&pdev->dev, "Removing device %u\n", zdev->domain);
        zdev->state = ZPCI_FN_STATE_CONFIGURED;
        zpci_dma_exit_device(zdev);
+       zpci_sysfs_remove_device(&pdev->dev);
        zpci_unmap_resources(pdev);
        list_del(&zdev->entry);         /* can be called from init */
        zdev->pdev = NULL;
@@ -671,6 +677,11 @@ void pcibios_disable_device(struct pci_dev *pdev)
        pdev->sysdata = NULL;
 }
 
+int pcibios_add_platform_entries(struct pci_dev *pdev)
+{
+       return zpci_sysfs_add_device(&pdev->dev);
+}
+
 int zpci_request_irq(unsigned int irq, irq_handler_t handler, void *data)
 {
        int msi_nr = irq_to_msi_nr(irq);
@@ -935,6 +946,8 @@ int zpci_create_device(struct zpci_dev *zdev)
 
        mutex_lock(&zpci_list_lock);
        list_add_tail(&zdev->entry, &zpci_list);
+       if (hotplug_ops.create_slot)
+               hotplug_ops.create_slot(zdev);
        mutex_unlock(&zpci_list_lock);
 
        if (zdev->state == ZPCI_FN_STATE_STANDBY)
@@ -948,6 +961,8 @@ int zpci_create_device(struct zpci_dev *zdev)
 out_start:
        mutex_lock(&zpci_list_lock);
        list_del(&zdev->entry);
+       if (hotplug_ops.remove_slot)
+               hotplug_ops.remove_slot(zdev);
        mutex_unlock(&zpci_list_lock);
 out_bus:
        zpci_free_domain(zdev);