aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2011-01-14 08:17:07 +0000
committerKeir Fraser <keir@xen.org>2011-01-14 08:17:07 +0000
commit8e56df6acffe292bad90d5680cd31b7ba1d845a4 (patch)
tree1b1223b45190765b8399d971a4370a9584b91db5
parent9d49dd444f1f501c248e0e08fe7126842f869624 (diff)
downloadxen-8e56df6acffe292bad90d5680cd31b7ba1d845a4.tar.gz
xen-8e56df6acffe292bad90d5680cd31b7ba1d845a4.tar.bz2
xen-8e56df6acffe292bad90d5680cd31b7ba1d845a4.zip
pv-drivers: use PCI interfaces to request IO and MEM resources on platform device
This is the correct interface to use and something has broken the use of the previous incorrect interface (which fails because the request conflicts with the resources assigned for the PCI device itself instead of nesting like the PCI interfaces do). pci_request_region() has been available since at least Linux 2.6.5. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Jan Beulich <jbeulich@novell.com> xen-unstable changeset: 22747:7bc5e072d986 xen-unstable date: Fri Jan 14 08:02:26 2011 +0000
-rw-r--r--unmodified_drivers/linux-2.6/platform-pci/platform-pci.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
index 74c851de91..759a0d1cae 100644
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -377,18 +377,13 @@ static int __devinit platform_pci_init(struct pci_dev *pdev,
return -ENOENT;
}
- if (request_mem_region(mmio_addr, mmio_len, DRV_NAME) == NULL) {
- printk(KERN_ERR ":MEM I/O resource 0x%lx @ 0x%lx busy\n",
- mmio_addr, mmio_len);
- return -EBUSY;
- }
+ ret = pci_request_region(pdev, 1, DRV_NAME);
+ if (ret < 0)
+ return ret;
- if (request_region(ioaddr, iolen, DRV_NAME) == NULL) {
- printk(KERN_ERR DRV_NAME ":I/O resource 0x%lx @ 0x%lx busy\n",
- iolen, ioaddr);
- release_mem_region(mmio_addr, mmio_len);
- return -EBUSY;
- }
+ ret = pci_request_region(pdev, 0, DRV_NAME);
+ if (ret < 0)
+ goto mem_out;
platform_mmio = mmio_addr;
platform_mmiolen = mmio_len;
@@ -424,8 +419,9 @@ static int __devinit platform_pci_init(struct pci_dev *pdev,
out:
if (ret) {
- release_mem_region(mmio_addr, mmio_len);
- release_region(ioaddr, iolen);
+ pci_release_region(pdev, 0);
+mem_out:
+ pci_release_region(pdev, 1);
}
return ret;