aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-07-20 13:32:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-07 20:14:53 -0400
commit2724f01856fafbe9f76d8e74a564b576b6f02d72 (patch)
tree6aff54bdd7c8f87f03167d2a3fd0b097ce0e0e21 /drivers/staging
parent325a01f38d8e443b9a10a84606740cf570efddd1 (diff)
staging: comedi: dt3000: ioremap'ed addresses are resource_size_t
As mentioned by Ian Abbott, the pci address passed to ioremap should be a resource_size_t not an unsigned long. Use a local variable of that type to hold the pci_resource_start() that is passed to ioremp(). Set the dev->iobase to a dummy non-zero value so that the "detach" can use it as a flag to know that comedi_pci_disable() needs to be called. Reported-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/drivers/dt3000.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c
index a6fe6c9be87..3476cda0fff 100644
--- a/drivers/staging/comedi/drivers/dt3000.c
+++ b/drivers/staging/comedi/drivers/dt3000.c
@@ -804,6 +804,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
804{ 804{
805 struct pci_dev *pcidev; 805 struct pci_dev *pcidev;
806 struct comedi_subdevice *s; 806 struct comedi_subdevice *s;
807 resource_size_t pci_base;
807 int ret = 0; 808 int ret = 0;
808 809
809 dev_dbg(dev->class_dev, "dt3000:\n"); 810 dev_dbg(dev->class_dev, "dt3000:\n");
@@ -820,9 +821,10 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
820 ret = comedi_pci_enable(pcidev, "dt3000"); 821 ret = comedi_pci_enable(pcidev, "dt3000");
821 if (ret < 0) 822 if (ret < 0)
822 return ret; 823 return ret;
824 dev->iobase = 1; /* the "detach" needs this */
823 825
824 dev->iobase = pci_resource_start(pcidev, 0); 826 pci_base = pci_resource_start(pcidev, 0);
825 devpriv->io_addr = ioremap(dev->iobase, DT3000_SIZE); 827 devpriv->io_addr = ioremap(pci_base, DT3000_SIZE);
826 if (!devpriv->io_addr) 828 if (!devpriv->io_addr)
827 return -ENOMEM; 829 return -ENOMEM;
828 830