diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-07-29 15:01:43 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-30 16:55:16 -0700 |
commit | 70f72867147b18fc36d2717cda6ddbaf4f71cf77 (patch) | |
tree | 3be0d140120ae45c62fb10326bcd16c351b43716 /drivers/staging/comedi/drivers/ni_labpc_pci.c | |
parent | adcd16a2983c4f29cabd0af3bc2881e97348a4ee (diff) |
staging: comedi: ni_labpc: use the comedi_device 'mmio' member
Use the new 'mmio' member in the comedi_device for the ioremap'ed
base address.
Only the ni_labpc_pci module does the ioremap, its also the only
module that sets the 'has_mmio' member in the boardinfo. Remove
this member from the boardinfo and use dev->mmio to determine if
the I/O is memory mapped.
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>
Diffstat (limited to 'drivers/staging/comedi/drivers/ni_labpc_pci.c')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_pci.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_pci.c b/drivers/staging/comedi/drivers/ni_labpc_pci.c index 5b59be3350ad..65984ea0a3ee 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_pci.c +++ b/drivers/staging/comedi/drivers/ni_labpc_pci.c @@ -48,7 +48,6 @@ static const struct labpc_boardinfo labpc_pci_boards[] = { .ai_scan_up = 1, .has_ao = 1, .is_labpc1200 = 1, - .has_mmio = 1, }, }; @@ -81,7 +80,6 @@ static int labpc_pci_auto_attach(struct comedi_device *dev, struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct labpc_boardinfo *board = NULL; struct labpc_private *devpriv; - void __iomem *mmio; int ret; if (context < ARRAY_SIZE(labpc_pci_boards)) @@ -99,10 +97,9 @@ static int labpc_pci_auto_attach(struct comedi_device *dev, if (ret) return ret; - mmio = pci_ioremap_bar(pcidev, 1); - if (!mmio) + dev->mmio = pci_ioremap_bar(pcidev, 1); + if (!dev->mmio) return -ENOMEM; - dev->iobase = (unsigned long)mmio; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); if (!devpriv) @@ -113,8 +110,8 @@ static int labpc_pci_auto_attach(struct comedi_device *dev, static void labpc_pci_detach(struct comedi_device *dev) { - if (dev->iobase) - iounmap((void __iomem *)dev->iobase); + if (dev->mmio) + iounmap(dev->mmio); if (dev->irq) free_irq(dev->irq, dev); comedi_pci_disable(dev); |