Skip to content

Commit

Permalink
staging: comedi: rti800: move the comedi_alloc_subdevices()
Browse files Browse the repository at this point in the history
For aesthetic reasons, move the call to comedi_alloc_subdevices()
so it occurs right before the subdevice init.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 9, 2013
1 parent c5eb6ea commit 849d1ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/comedi/drivers/rti800.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,6 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
inb(dev->iobase + RTI800_ADCHI);
outb(0, dev->iobase + RTI800_CLRFLAGS);

ret = comedi_alloc_subdevices(dev, 4);
if (ret)
return ret;

devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
if (!devpriv)
return -ENOMEM;
Expand All @@ -329,6 +325,10 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->dac1_coding = it->options[8];
devpriv->muxgain_bits = -1;

ret = comedi_alloc_subdevices(dev, 4);
if (ret)
return ret;

s = &dev->subdevices[0];
/* ai subdevice */
s->type = COMEDI_SUBD_AI;
Expand Down

0 comments on commit 849d1ea

Please sign in to comment.