diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 19:18:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 15:47:40 -0400 |
commit | 6ca3f28b8529d9401a7be7641a8951c12443e05d (patch) | |
tree | a867fe2171e9143cee19d21c796a95a1a3f3963a /drivers/staging | |
parent | 3871a752ec5695d84dd9d24d55daed3b72023268 (diff) |
staging: comedi: dt2811: use comedi_request_region()
Use comedi_request_region() to request the I/O region used by this
driver.
Remove the noise when the board is first attached as well as the
error 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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/comedi/drivers/dt2811.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c index be9aaa7e42c6..16cbd540ab31 100644 --- a/drivers/staging/comedi/drivers/dt2811.c +++ b/drivers/staging/comedi/drivers/dt2811.c | |||
@@ -399,18 +399,10 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
399 | struct dt2811_private *devpriv; | 399 | struct dt2811_private *devpriv; |
400 | int ret; | 400 | int ret; |
401 | struct comedi_subdevice *s; | 401 | struct comedi_subdevice *s; |
402 | unsigned long iobase; | ||
403 | 402 | ||
404 | iobase = it->options[0]; | 403 | ret = comedi_request_region(dev, it->options[0], DT2811_SIZE); |
405 | 404 | if (ret) | |
406 | printk(KERN_INFO "comedi%d: dt2811:base=0x%04lx\n", dev->minor, iobase); | 405 | return ret; |
407 | |||
408 | if (!request_region(iobase, DT2811_SIZE, dev->board_name)) { | ||
409 | printk(KERN_ERR "I/O port conflict\n"); | ||
410 | return -EIO; | ||
411 | } | ||
412 | |||
413 | dev->iobase = iobase; | ||
414 | 406 | ||
415 | #if 0 | 407 | #if 0 |
416 | outb(0, dev->iobase + DT2811_ADCSR); | 408 | outb(0, dev->iobase + DT2811_ADCSR); |