diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 23:24:42 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 19:47:51 (GMT) |
commit | 3671cae1d8fd4bc7fa7d85ec35f2d2149652c7ad (patch) | |
tree | d90e09bf9e0c8105f53e60eaafd88ed124e2439b /drivers | |
parent | f19df8b0c0a9598bf469692e28dc31c8c0dc1e89 (diff) | |
download | linux-fsl-qoriq-3671cae1d8fd4bc7fa7d85ec35f2d2149652c7ad.tar.xz |
staging: comedi: ni_at_a2150: 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')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_at_a2150.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c index 974704f..8cd6604 100644 --- a/drivers/staging/comedi/drivers/ni_at_a2150.c +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c @@ -719,43 +719,20 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) const struct a2150_board *thisboard = comedi_board(dev); struct a2150_private *devpriv; struct comedi_subdevice *s; - unsigned long iobase = it->options[0]; unsigned int irq = it->options[1]; unsigned int dma = it->options[2]; static const int timeout = 2000; int i; int ret; - printk("comedi%d: %s: io 0x%lx", dev->minor, dev->driver->driver_name, - iobase); - if (irq) { - printk(", irq %u", irq); - } else { - printk(", no irq"); - } - if (dma) { - printk(", dma %u", dma); - } else { - printk(", no dma"); - } - printk("\n"); - devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); if (!devpriv) return -ENOMEM; dev->private = devpriv; - if (iobase == 0) { - printk(" io base address required\n"); - return -EINVAL; - } - - /* check if io addresses are available */ - if (!request_region(iobase, A2150_SIZE, dev->driver->driver_name)) { - printk(" I/O port conflict\n"); - return -EIO; - } - dev->iobase = iobase; + ret = comedi_request_region(dev, it->options[0], A2150_SIZE); + if (ret) + return ret; /* grab our IRQ */ if (irq) { |