To better match the pcl818 and pcl816 drivers, allocate the private data before
calling comedi_request_region().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int ret;
int i;
- ret = comedi_request_region(dev, it->options[0], 0x10);
- if (ret)
- return ret;
-
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (!devpriv)
return -ENOMEM;
+ ret = comedi_request_region(dev, it->options[0], 0x10);
+ if (ret)
+ return ret;
+
if ((1 << it->options[1]) & board->IRQbits) {
ret = request_irq(it->options[1], interrupt_pcl812, 0,
dev->board_name, dev);