{
struct adq12b_private *devpriv;
struct comedi_subdevice *s;
- unsigned long iobase;
int unipolar, differential;
int ret;
- iobase = it->options[0];
unipolar = it->options[1];
differential = it->options[2];
- printk(KERN_INFO "comedi%d: adq12b called with options base=0x%03lx, "
- "%s and %s\n", dev->minor, iobase,
- (unipolar == 1) ? "unipolar" : "bipolar",
- (differential == 1) ? "differential" : "single-ended");
-
- /* if no address was specified, try the default 0x300 */
- if (iobase == 0) {
- printk(KERN_WARNING "comedi%d: adq12b warning: I/O base "
- "address not specified. Trying the default 0x300.\n",
- dev->minor);
- iobase = 0x300;
- }
-
- printk("comedi%d: adq12b: 0x%04lx ", dev->minor, iobase);
- if (!request_region(iobase, ADQ12B_SIZE, "adq12b")) {
- printk("I/O port conflict\n");
- return -EIO;
- }
- dev->iobase = iobase;
+ ret = comedi_request_region(dev, it->options[0], ADQ12B_SIZE);
+ if (ret)
+ return ret;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
if (!devpriv)
s->range_table = &range_digital;
s->insn_bits = adq12b_do_insn_bits;
- printk(KERN_INFO "attached\n");
-
return 0;
}