diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 19:18:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 15:47:40 -0400 |
commit | c5c18cd3661e57ef09b545570dac891c53b981e4 (patch) | |
tree | d952d24cae5d756a8e55b72b3c689b5336cda17f /drivers/staging | |
parent | 6ca3f28b8529d9401a7be7641a8951c12443e05d (diff) |
staging: comedi: dt2814: 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/dt2814.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index e4d629e6d06e..46dca8e8a8a1 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c | |||
@@ -246,15 +246,10 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
246 | int i, irq; | 246 | int i, irq; |
247 | int ret; | 247 | int ret; |
248 | struct comedi_subdevice *s; | 248 | struct comedi_subdevice *s; |
249 | unsigned long iobase; | ||
250 | 249 | ||
251 | iobase = it->options[0]; | 250 | ret = comedi_request_region(dev, it->options[0], DT2814_SIZE); |
252 | printk(KERN_INFO "comedi%d: dt2814: 0x%04lx ", dev->minor, iobase); | 251 | if (ret) |
253 | if (!request_region(iobase, DT2814_SIZE, "dt2814")) { | 252 | return ret; |
254 | printk(KERN_ERR "I/O port conflict\n"); | ||
255 | return -EIO; | ||
256 | } | ||
257 | dev->iobase = iobase; | ||
258 | 253 | ||
259 | outb(0, dev->iobase + DT2814_CSR); | 254 | outb(0, dev->iobase + DT2814_CSR); |
260 | udelay(100); | 255 | udelay(100); |