From 49267e0bf3019487624067c74bcf6deaab829e9a Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 12 Apr 2013 13:00:49 +0100 Subject: [PATCH] --- yaml --- r: 364134 b: refs/heads/master c: c400c1e1c42d4acff3e1dc0dade184f01b45e8a2 h: refs/heads/master v: v3 --- [refs] | 2 +- .../staging/comedi/drivers/amplc_dio200_pci.c | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index ca589f3fc251..c0ad70a6788e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fed9fd2cc6ac2b01f928bef3ce62a9d8058f514d +refs/heads/master: c400c1e1c42d4acff3e1dc0dade184f01b45e8a2 diff --git a/trunk/drivers/staging/comedi/drivers/amplc_dio200_pci.c b/trunk/drivers/staging/comedi/drivers/amplc_dio200_pci.c index 232620c65ff1..4be44e877373 100644 --- a/trunk/drivers/staging/comedi/drivers/amplc_dio200_pci.c +++ b/trunk/drivers/staging/comedi/drivers/amplc_dio200_pci.c @@ -339,7 +339,6 @@ static int dio200_pcie_board_setup(struct comedi_device *dev) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); void __iomem *brbase; - resource_size_t brlen; /* * The board uses Altera Cyclone IV with PCI-Express hard IP. @@ -351,13 +350,11 @@ static int dio200_pcie_board_setup(struct comedi_device *dev) * Enable" register at offset 0x50 to allow generation of PCIe * interrupts when RXmlrq_i is asserted in the SOPC Builder system. */ - brlen = pci_resource_len(pcidev, 0); - if (brlen < 0x4000 || - !(pci_resource_flags(pcidev, 0) & IORESOURCE_MEM)) { + if (pci_resource_len(pcidev, 0) < 0x4000) { dev_err(dev->class_dev, "error! bad PCI region!\n"); return -EINVAL; } - brbase = ioremap_nocache(pci_resource_start(pcidev, 0), brlen); + brbase = pci_ioremap_bar(pcidev, 0); if (!brbase) { dev_err(dev->class_dev, "error! failed to map registers!\n"); return -ENOMEM; @@ -375,7 +372,6 @@ static int dio200_pci_auto_attach(struct comedi_device *dev, struct pci_dev *pci_dev = comedi_to_pci_dev(dev); const struct dio200_board *thisboard = NULL; struct dio200_private *devpriv; - resource_size_t base, len; unsigned int bar; int ret; @@ -399,14 +395,12 @@ static int dio200_pci_auto_attach(struct comedi_device *dev, return ret; bar = thisboard->mainbar; - base = pci_resource_start(pci_dev, bar); - len = pci_resource_len(pci_dev, bar); - if (len < thisboard->mainsize) { + if (pci_resource_len(pci_dev, bar) < thisboard->mainsize) { dev_err(dev->class_dev, "error! PCI region size too small!\n"); return -EINVAL; } if (pci_resource_flags(pci_dev, bar) & IORESOURCE_MEM) { - devpriv->io.u.membase = ioremap_nocache(base, len); + devpriv->io.u.membase = pci_ioremap_bar(pci_dev, bar); if (!devpriv->io.u.membase) { dev_err(dev->class_dev, "error! cannot remap registers\n"); @@ -414,7 +408,7 @@ static int dio200_pci_auto_attach(struct comedi_device *dev, } devpriv->io.regtype = mmio_regtype; } else { - devpriv->io.u.iobase = (unsigned long)base; + devpriv->io.u.iobase = pci_resource_start(pci_dev, bar); devpriv->io.regtype = io_regtype; } switch (context_model) {