diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-08 18:16:22 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-09 16:29:03 -0700 |
commit | 849d1ea4ae28e57557ad8901837d36aa2a760b5e (patch) | |
tree | 3c3416f44fb6dcc1106d29293203b8c3b4c10e08 /drivers/staging/comedi/drivers/rti800.c | |
parent | c5eb6eadec53012ddd820dbab686665b02313dca (diff) |
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: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/rti800.c')
-rw-r--r-- | drivers/staging/comedi/drivers/rti800.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/rti800.c b/drivers/staging/comedi/drivers/rti800.c index fdd248e8b5e9..2bc6e8e581e7 100644 --- a/drivers/staging/comedi/drivers/rti800.c +++ b/drivers/staging/comedi/drivers/rti800.c @@ -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; @@ -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; |