aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 21:44:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 21:44:52 -0500
commit2c0076d8c7eb1dafa03d0a792444862080b34106 (patch)
tree93e1b6194b05b3c1c5c30ddece52484f48a61229 /drivers/xen
parent50de1dd967d4ba3b8a90ebe7a4f5feca24191317 (diff)
parente528db5b392ab2a624258a667fed0e65af6e411b (diff)
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.
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/Kconfig2
-rw-r--r--drivers/xen/Makefile3
-rw-r--r--drivers/xen/platform-pci.c21
3 files changed, 10 insertions, 16 deletions
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 5a48ce996dea..464d8935ad4e 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -75,7 +75,7 @@ config XEN_XENBUS_FRONTEND
75 75
76config XEN_PLATFORM_PCI 76config XEN_PLATFORM_PCI
77 tristate "xen platform pci device driver" 77 tristate "xen platform pci device driver"
78 depends on XEN_PVHVM 78 depends on XEN_PVHVM && PCI
79 default m 79 default m
80 help 80 help
81 Driver for the Xen PCI Platform device: it is responsible for 81 Driver for the Xen PCI Platform device: it is responsible for
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 533a199e7a3f..f81819b0f916 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -11,9 +11,10 @@ obj-$(CONFIG_XEN_BALLOON) += balloon.o
11obj-$(CONFIG_XEN_DEV_EVTCHN) += xen-evtchn.o 11obj-$(CONFIG_XEN_DEV_EVTCHN) += xen-evtchn.o
12obj-$(CONFIG_XENFS) += xenfs/ 12obj-$(CONFIG_XENFS) += xenfs/
13obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o 13obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o
14obj-$(CONFIG_XEN_PLATFORM_PCI) += platform-pci.o 14obj-$(CONFIG_XEN_PLATFORM_PCI) += xen-platform-pci.o
15obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o 15obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o
16obj-$(CONFIG_XEN_DOM0) += pci.o 16obj-$(CONFIG_XEN_DOM0) += pci.o
17 17
18xen-evtchn-y := evtchn.o 18xen-evtchn-y := evtchn.o
19 19
20xen-platform-pci-y := platform-pci.o
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index c01b5ddce529..afbe041f42c5 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -105,7 +105,7 @@ static int __devinit platform_pci_init(struct pci_dev *pdev,
105 const struct pci_device_id *ent) 105 const struct pci_device_id *ent)
106{ 106{
107 int i, ret; 107 int i, ret;
108 long ioaddr, iolen; 108 long ioaddr;
109 long mmio_addr, mmio_len; 109 long mmio_addr, mmio_len;
110 unsigned int max_nr_gframes; 110 unsigned int max_nr_gframes;
111 111
@@ -114,7 +114,6 @@ static int __devinit platform_pci_init(struct pci_dev *pdev,
114 return i; 114 return i;
115 115
116 ioaddr = pci_resource_start(pdev, 0); 116 ioaddr = pci_resource_start(pdev, 0);
117 iolen = pci_resource_len(pdev, 0);
118 117
119 mmio_addr = pci_resource_start(pdev, 1); 118 mmio_addr = pci_resource_start(pdev, 1);
120 mmio_len = pci_resource_len(pdev, 1); 119 mmio_len = pci_resource_len(pdev, 1);
@@ -125,19 +124,13 @@ static int __devinit platform_pci_init(struct pci_dev *pdev,
125 goto pci_out; 124 goto pci_out;
126 } 125 }
127 126
128 if (request_mem_region(mmio_addr, mmio_len, DRV_NAME) == NULL) { 127 ret = pci_request_region(pdev, 1, DRV_NAME);
129 dev_err(&pdev->dev, "MEM I/O resource 0x%lx @ 0x%lx busy\n", 128 if (ret < 0)
130 mmio_addr, mmio_len);
131 ret = -EBUSY;
132 goto pci_out; 129 goto pci_out;
133 }
134 130
135 if (request_region(ioaddr, iolen, DRV_NAME) == NULL) { 131 ret = pci_request_region(pdev, 0, DRV_NAME);
136 dev_err(&pdev->dev, "I/O resource 0x%lx @ 0x%lx busy\n", 132 if (ret < 0)
137 iolen, ioaddr);
138 ret = -EBUSY;
139 goto mem_out; 133 goto mem_out;
140 }
141 134
142 platform_mmio = mmio_addr; 135 platform_mmio = mmio_addr;
143 platform_mmiolen = mmio_len; 136 platform_mmiolen = mmio_len;
@@ -169,9 +162,9 @@ static int __devinit platform_pci_init(struct pci_dev *pdev,
169 return 0; 162 return 0;
170 163
171out: 164out:
172 release_region(ioaddr, iolen); 165 pci_release_region(pdev, 0);
173mem_out: 166mem_out:
174 release_mem_region(mmio_addr, mmio_len); 167 pci_release_region(pdev, 1);
175pci_out: 168pci_out:
176 pci_disable_device(pdev); 169 pci_disable_device(pdev);
177 return ret; 170 return ret;