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

staging: comedi: rti800: move the comedi_alloc_subdevices()

For aesthetic reasons, move the call to comedi_alloc_subdevices()
so it occurs right before the subdevice init.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c5eb6ead
...@@ -311,10 +311,6 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -311,10 +311,6 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
inb(dev->iobase + RTI800_ADCHI); inb(dev->iobase + RTI800_ADCHI);
outb(0, dev->iobase + RTI800_CLRFLAGS); outb(0, dev->iobase + RTI800_CLRFLAGS);
ret = comedi_alloc_subdevices(dev, 4);
if (ret)
return ret;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
if (!devpriv) if (!devpriv)
return -ENOMEM; return -ENOMEM;
...@@ -329,6 +325,10 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -329,6 +325,10 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->dac1_coding = it->options[8]; devpriv->dac1_coding = it->options[8];
devpriv->muxgain_bits = -1; devpriv->muxgain_bits = -1;
ret = comedi_alloc_subdevices(dev, 4);
if (ret)
return ret;
s = &dev->subdevices[0]; s = &dev->subdevices[0];
/* ai subdevice */ /* ai subdevice */
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
......
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