Commit c9968ed9 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcl812: allocate private data before requesting the I/O region

To better match the pcl818 and pcl816 drivers, allocate the private data before
calling comedi_request_region().
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 243e7146
......@@ -1247,14 +1247,14 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment