Skip to content

Commit

Permalink
staging: comedi: aio_iiro_16: use comedi_request_region()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent a595851 commit c8c90a7
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions drivers/staging/comedi/drivers/aio_iiro_16.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,12 @@ static int aio_iiro_16_dio_insn_bits_read(struct comedi_device *dev,
static int aio_iiro_16_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
int iobase;
struct comedi_subdevice *s;
int ret;

printk(KERN_INFO "comedi%d: aio_iiro_16: ", dev->minor);

iobase = it->options[0];

if (!request_region(iobase, AIO_IIRO_16_SIZE, dev->board_name)) {
printk("I/O port conflict");
return -EIO;
}

dev->iobase = iobase;
ret = comedi_request_region(dev, it->options[0], AIO_IIRO_16_SIZE);
if (ret)
return ret;

ret = comedi_alloc_subdevices(dev, 2);
if (ret)
Expand All @@ -112,8 +104,6 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
s->range_table = &range_digital;
s->insn_bits = aio_iiro_16_dio_insn_bits_read;

printk("attached\n");

return 1;
}

Expand Down

0 comments on commit c8c90a7

Please sign in to comment.