From: H Hartley Sweeten Date: Wed, 10 Apr 2013 18:28:28 +0000 (-0700) Subject: staging: comedi: cb_pcidas64: use pci_ioremap_bar() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c71b2e52a0fb895ad709dbe8caec3dfd2a612c04;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: cb_pcidas64: use pci_ioremap_bar() Use pci_ioremap_bar() to ioremap the PCI resources. That function just takes the pci device and a bar number. It also has some additional sanity checks to make sure the bar is actually a memory resource. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index de5c8faa91d8..7599053df807 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -4061,16 +4061,9 @@ static int auto_attach(struct comedi_device *dev, devpriv->dio_counter_phys_iobase = pci_resource_start(pcidev, 3); - /* remap, won't work with 2.0 kernels but who cares */ - devpriv->plx9080_iobase = - ioremap(devpriv->plx9080_phys_iobase, - pci_resource_len(pcidev, 0)); - devpriv->main_iobase = - ioremap(devpriv->main_phys_iobase, - pci_resource_len(pcidev, 2)); - devpriv->dio_counter_iobase = - ioremap(devpriv->dio_counter_phys_iobase, - pci_resource_len(pcidev, 3)); + devpriv->plx9080_iobase = pci_ioremap_bar(pcidev, 0); + devpriv->main_iobase = pci_ioremap_bar(pcidev, 2); + devpriv->dio_counter_iobase = pci_ioremap_bar(pcidev, 3); if (!devpriv->plx9080_iobase || !devpriv->main_iobase || !devpriv->dio_counter_iobase) {