struct comedi_subdevice *s;
int ret;
unsigned int irq;
- unsigned long iobase;
unsigned int dma_chan;
int timer_mode;
unsigned long flags;
struct comedi_krange *user_ai_range, *user_ao_range;
- iobase = it->options[0];
#if 0
irq = it->options[1];
timer_mode = it->options[8];
if (timer_mode)
irq = 0;
- printk(KERN_INFO "comedi%d: das16:", dev->minor);
-
/* check that clock setting is valid */
if (it->options[3]) {
if (it->options[3] != 0 &&
dev->private = devpriv;
if (board->size < 0x400) {
- printk(" 0x%04lx-0x%04lx\n", iobase, iobase + board->size);
- if (!request_region(iobase, board->size, dev->board_name)) {
- printk(KERN_ERR " I/O port conflict\n");
- return -EIO;
- }
+ ret = comedi_request_region(dev, it->options[0], board->size);
+ if (ret)
+ return ret;
} else {
- printk(KERN_INFO " 0x%04lx-0x%04lx 0x%04lx-0x%04lx\n",
- iobase, iobase + 0x0f,
- iobase + 0x400,
- iobase + 0x400 + (board->size & 0x3ff));
- if (!request_region(iobase, 0x10, dev->board_name)) {
- printk(KERN_ERR " I/O port conflict: 0x%04lx-0x%04lx\n",
- iobase, iobase + 0x0f);
- return -EIO;
- }
- if (!request_region(iobase + 0x400, board->size & 0x3ff,
+ ret = comedi_request_region(dev, it->options[0], 0x10);
+ if (ret)
+ return ret;
+ /* Request an additional region for the 8255 */
+ if (!request_region(dev->iobase + 0x400, board->size & 0x3ff,
dev->board_name)) {
- release_region(iobase, 0x10);
- printk(KERN_ERR " I/O port conflict: 0x%04lx-0x%04lx\n",
- iobase + 0x400,
- iobase + 0x400 + (board->size & 0x3ff));
+ release_region(dev->iobase, 0x10);
+ dev_warn(dev->class_dev,
+ "%s: I/O port conflict (%#lx,%d)\n",
+ dev->board_name,
+ dev->iobase + 0x400, board->size & 0x3ff);
+ dev->iobase = 0;
return -EIO;
}
}
- dev->iobase = iobase;
-
/* probe id bits to make sure they are consistent */
if (das16_probe(dev, it)) {
printk(KERN_ERR " id bits do not match selected board, aborting\n");