Skip to content

Commit

Permalink
staging: comedi: cb_pcidas64: use pci_ioremap_bar()
Browse files Browse the repository at this point in the history
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 <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent 8b46d7d commit c71b2e5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/staging/comedi/drivers/cb_pcidas64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c71b2e5

Please sign in to comment.