diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2013-06-05 10:06:16 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-06-26 15:10:06 -0400 |
commit | 944239c59e93a2a76c0c0dfa473700f82572e17d (patch) | |
tree | 89caa0f12802dddf7fe1e1ee18377724f8ad0a48 /arch/s390/pci | |
parent | 44b9ca47534d478bf9954d380515cb282fcb48a2 (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.c | 26 |
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 | |||
570 | static 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 | ||
570 | struct zpci_dev *zpci_alloc_device(void) | 584 | struct 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 | ||
827 | void 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 | |||
813 | static int zpci_scan_bus(struct zpci_dev *zdev) | 837 | static int zpci_scan_bus(struct zpci_dev *zdev) |
814 | { | 838 | { |
815 | struct resource *res; | 839 | struct resource *res; |