Merge branch 'stable/platform-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

* 'stable/platform-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen-platform: Fix compile errors if CONFIG_PCI is not enabled.
xen: rename platform-pci module to xen-platform-pci.
xen-platform: use PCI interfaces to request IO and MEM resources.

+10 -16
+1 -1
drivers/xen/Kconfig
··· 75 75 76 76 config XEN_PLATFORM_PCI 77 77 tristate "xen platform pci device driver" 78 - depends on XEN_PVHVM 78 + depends on XEN_PVHVM && PCI 79 79 default m 80 80 help 81 81 Driver for the Xen PCI Platform device: it is responsible for
+2 -1
drivers/xen/Makefile
··· 11 11 obj-$(CONFIG_XEN_DEV_EVTCHN) += xen-evtchn.o 12 12 obj-$(CONFIG_XENFS) += xenfs/ 13 13 obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o 14 - obj-$(CONFIG_XEN_PLATFORM_PCI) += platform-pci.o 14 + obj-$(CONFIG_XEN_PLATFORM_PCI) += xen-platform-pci.o 15 15 obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o 16 16 obj-$(CONFIG_XEN_DOM0) += pci.o 17 17 18 18 xen-evtchn-y := evtchn.o 19 19 20 + xen-platform-pci-y := platform-pci.o
+7 -14
drivers/xen/platform-pci.c
··· 105 105 const struct pci_device_id *ent) 106 106 { 107 107 int i, ret; 108 - long ioaddr, iolen; 108 + long ioaddr; 109 109 long mmio_addr, mmio_len; 110 110 unsigned int max_nr_gframes; 111 111 ··· 114 114 return i; 115 115 116 116 ioaddr = pci_resource_start(pdev, 0); 117 - iolen = pci_resource_len(pdev, 0); 118 117 119 118 mmio_addr = pci_resource_start(pdev, 1); 120 119 mmio_len = pci_resource_len(pdev, 1); ··· 124 125 goto pci_out; 125 126 } 126 127 127 - if (request_mem_region(mmio_addr, mmio_len, DRV_NAME) == NULL) { 128 - dev_err(&pdev->dev, "MEM I/O resource 0x%lx @ 0x%lx busy\n", 129 - mmio_addr, mmio_len); 130 - ret = -EBUSY; 128 + ret = pci_request_region(pdev, 1, DRV_NAME); 129 + if (ret < 0) 131 130 goto pci_out; 132 - } 133 131 134 - if (request_region(ioaddr, iolen, DRV_NAME) == NULL) { 135 - dev_err(&pdev->dev, "I/O resource 0x%lx @ 0x%lx busy\n", 136 - iolen, ioaddr); 137 - ret = -EBUSY; 132 + ret = pci_request_region(pdev, 0, DRV_NAME); 133 + if (ret < 0) 138 134 goto mem_out; 139 - } 140 135 141 136 platform_mmio = mmio_addr; 142 137 platform_mmiolen = mmio_len; ··· 162 169 return 0; 163 170 164 171 out: 165 - release_region(ioaddr, iolen); 172 + pci_release_region(pdev, 0); 166 173 mem_out: 167 - release_mem_region(mmio_addr, mmio_len); 174 + pci_release_region(pdev, 1); 168 175 pci_out: 169 176 pci_disable_device(pdev); 170 177 return ret;