aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2013-06-05 10:06:16 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-06-26 15:10:06 -0400
commit944239c59e93a2a76c0c0dfa473700f82572e17d (patch)
tree89caa0f12802dddf7fe1e1ee18377724f8ad0a48 /arch/s390/pci
parent44b9ca47534d478bf9954d380515cb282fcb48a2 (diff)
s390/pci: implement pcibios_release_device
Use pcibios_release_device to implement architecture-specific functionality when a pci device is released. This function will be called during pci_release_dev. Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r--arch/s390/pci/pci.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index f1e5be85d592..a56fce445c39 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -565,7 +565,21 @@ static void zpci_map_resources(struct zpci_dev *zdev)
565 pr_debug("BAR%i: -> start: %Lx end: %Lx\n", 565 pr_debug("BAR%i: -> start: %Lx end: %Lx\n",
566 i, pdev->resource[i].start, pdev->resource[i].end); 566 i, pdev->resource[i].start, pdev->resource[i].end);
567 } 567 }
568}; 568}
569
570static void zpci_unmap_resources(struct zpci_dev *zdev)
571{
572 struct pci_dev *pdev = zdev->pdev;
573 resource_size_t len;
574 int i;
575
576 for (i = 0; i < PCI_BAR_COUNT; i++) {
577 len = pci_resource_len(pdev, i);
578 if (!len)
579 continue;
580 pci_iounmap(pdev, (void *) pdev->resource[i].start);
581 }
582}
569 583
570struct zpci_dev *zpci_alloc_device(void) 584struct zpci_dev *zpci_alloc_device(void)
571{ 585{
@@ -810,6 +824,16 @@ int pcibios_add_device(struct pci_dev *pdev)
810 return 0; 824 return 0;
811} 825}
812 826
827void pcibios_release_device(struct pci_dev *pdev)
828{
829 struct zpci_dev *zdev = get_zdev(pdev);
830
831 zpci_unmap_resources(zdev);
832 zpci_fmb_disable_device(zdev);
833 zpci_debug_exit_device(zdev);
834 zdev->pdev = NULL;
835}
836
813static int zpci_scan_bus(struct zpci_dev *zdev) 837static int zpci_scan_bus(struct zpci_dev *zdev)
814{ 838{
815 struct resource *res; 839 struct resource *res;