staging: comedi: das6402: use comedi_request_region()
Use comedi_request_region() to request the I/O region used by this driver. Remove the default iobase address (0x300) that is used when the user does not pass a base address during the "comedi_config". Comedi legacy drivers should only attach to a specified address. Remove the dev_err() message when the request_region() fails, comedi_request_reqion() will output the error message if necessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
29a879b125
commit
7d9455c5c1
1 changed files with 3 additions and 12 deletions
|
@ -284,21 +284,12 @@ static int das6402_attach(struct comedi_device *dev,
|
||||||
{
|
{
|
||||||
struct das6402_private *devpriv;
|
struct das6402_private *devpriv;
|
||||||
unsigned int irq;
|
unsigned int irq;
|
||||||
unsigned long iobase;
|
|
||||||
int ret;
|
int ret;
|
||||||
struct comedi_subdevice *s;
|
struct comedi_subdevice *s;
|
||||||
|
|
||||||
iobase = it->options[0];
|
ret = comedi_request_region(dev, it->options[0], DAS6402_SIZE);
|
||||||
if (iobase == 0)
|
if (ret)
|
||||||
iobase = 0x300;
|
return ret;
|
||||||
|
|
||||||
if (!request_region(iobase, DAS6402_SIZE, "das6402")) {
|
|
||||||
dev_err(dev->class_dev, "I/O port conflict\n");
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
dev->iobase = iobase;
|
|
||||||
|
|
||||||
/* should do a probe here */
|
|
||||||
|
|
||||||
irq = it->options[0];
|
irq = it->options[0];
|
||||||
dev_dbg(dev->class_dev, "( irq = %u )\n", irq);
|
dev_dbg(dev->class_dev, "( irq = %u )\n", irq);
|
||||||
|
|
Loading…
Add table
Reference in a new issue