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)
s->range_table = &range_digital;
s->insn_bits = aio_iiro_16_dio_insn_bits_read;
- printk("attached\n");
-
return 1;
}