Commit 9bfa0d54 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: amplc_dio200: set dev->iobase before common attach

Don't pass the I/O base address to `dio200_common_attach()`.  The only
thing it does with it is set `dev->iobase` to the passed in value.  Do
that before calling `dio200_common_attach()` in order to simplify
upcoming support for different register access methods.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c10aa035
...@@ -1427,8 +1427,8 @@ static void dio200_report_attach(struct comedi_device *dev, unsigned int irq) ...@@ -1427,8 +1427,8 @@ static void dio200_report_attach(struct comedi_device *dev, unsigned int irq)
dev_info(dev->class_dev, "%s %sattached\n", dev->board_name, tmpbuf); dev_info(dev->class_dev, "%s %sattached\n", dev->board_name, tmpbuf);
} }
static int dio200_common_attach(struct comedi_device *dev, unsigned long iobase, static int dio200_common_attach(struct comedi_device *dev, unsigned int irq,
unsigned int irq, unsigned long req_irq_flags) unsigned long req_irq_flags)
{ {
const struct dio200_board *thisboard = comedi_board(dev); const struct dio200_board *thisboard = comedi_board(dev);
struct dio200_private *devpriv = dev->private; struct dio200_private *devpriv = dev->private;
...@@ -1439,7 +1439,6 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned long iobase, ...@@ -1439,7 +1439,6 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned long iobase,
int ret; int ret;
devpriv->intr_sd = -1; devpriv->intr_sd = -1;
dev->iobase = iobase;
dev->board_name = thisboard->name; dev->board_name = thisboard->name;
ret = comedi_alloc_subdevices(dev, layout->n_subdevs); ret = comedi_alloc_subdevices(dev, layout->n_subdevs);
...@@ -1527,7 +1526,8 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1527,7 +1526,8 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
ret = dio200_request_region(dev, iobase, DIO200_IO_SIZE); ret = dio200_request_region(dev, iobase, DIO200_IO_SIZE);
if (ret < 0) if (ret < 0)
return ret; return ret;
return dio200_common_attach(dev, iobase, irq, 0); dev->iobase = iobase;
return dio200_common_attach(dev, irq, 0);
} else if (is_pci_board(thisboard)) { } else if (is_pci_board(thisboard)) {
dev_err(dev->class_dev, dev_err(dev->class_dev,
"Manual configuration of PCI board '%s' is not supported\n", "Manual configuration of PCI board '%s' is not supported\n",
...@@ -1549,7 +1549,6 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev, ...@@ -1549,7 +1549,6 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev,
struct pci_dev *pci_dev) struct pci_dev *pci_dev)
{ {
struct dio200_private *devpriv; struct dio200_private *devpriv;
unsigned long iobase;
int ret; int ret;
if (!DO_PCI) if (!DO_PCI)
...@@ -1574,8 +1573,8 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev, ...@@ -1574,8 +1573,8 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev,
"error! cannot enable PCI device and request regions!\n"); "error! cannot enable PCI device and request regions!\n");
return ret; return ret;
} }
iobase = pci_resource_start(pci_dev, 2); dev->iobase = pci_resource_start(pci_dev, 2);
return dio200_common_attach(dev, iobase, pci_dev->irq, IRQF_SHARED); return dio200_common_attach(dev, pci_dev->irq, IRQF_SHARED);
} }
static void dio200_detach(struct comedi_device *dev) static void dio200_detach(struct comedi_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment