mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 05:22:19 -04:00
staging: comedi: ni_at_ao: tidy up atao_attach()
For aesthetics, add some whitespace to the subdevice init. Remove the printk noise at the end of the attach. 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bf9fab836f
commit
32d5767a49
@@ -340,11 +340,8 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||
const struct atao_board *board = comedi_board(dev);
|
||||
struct atao_private *devpriv;
|
||||
struct comedi_subdevice *s;
|
||||
int ao_unipolar;
|
||||
int ret;
|
||||
|
||||
ao_unipolar = it->options[3];
|
||||
|
||||
ret = comedi_request_region(dev, it->options[0], 0x20);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -357,28 +354,25 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Analog Output subdevice */
|
||||
s = &dev->subdevices[0];
|
||||
/* analog output subdevice */
|
||||
s->type = COMEDI_SUBD_AO;
|
||||
s->subdev_flags = SDF_WRITABLE;
|
||||
s->n_chan = board->n_ao_chans;
|
||||
s->maxdata = (1 << 12) - 1;
|
||||
if (ao_unipolar)
|
||||
s->range_table = &range_unipolar10;
|
||||
else
|
||||
s->range_table = &range_bipolar10;
|
||||
s->insn_write = atao_ao_insn_write;
|
||||
s->insn_read = atao_ao_insn_read;
|
||||
s->type = COMEDI_SUBD_AO;
|
||||
s->subdev_flags = SDF_WRITABLE;
|
||||
s->n_chan = board->n_ao_chans;
|
||||
s->maxdata = 0x0fff;
|
||||
s->range_table = it->options[3] ? &range_unipolar10 : &range_bipolar10;
|
||||
s->insn_write = atao_ao_insn_write;
|
||||
s->insn_read = atao_ao_insn_read;
|
||||
|
||||
/* Digital I/O subdevice */
|
||||
s = &dev->subdevices[1];
|
||||
/* digital i/o subdevice */
|
||||
s->type = COMEDI_SUBD_DIO;
|
||||
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
|
||||
s->n_chan = 8;
|
||||
s->maxdata = 1;
|
||||
s->range_table = &range_digital;
|
||||
s->insn_bits = atao_dio_insn_bits;
|
||||
s->insn_config = atao_dio_insn_config;
|
||||
s->type = COMEDI_SUBD_DIO;
|
||||
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
|
||||
s->n_chan = 8;
|
||||
s->maxdata = 1;
|
||||
s->range_table = &range_digital;
|
||||
s->insn_bits = atao_dio_insn_bits;
|
||||
s->insn_config = atao_dio_insn_config;
|
||||
|
||||
/* caldac subdevice */
|
||||
s = &dev->subdevices[2];
|
||||
@@ -389,15 +383,12 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||
s->insn_read = atao_calib_insn_read;
|
||||
s->insn_write = atao_calib_insn_write;
|
||||
|
||||
/* EEPROM subdevice */
|
||||
s = &dev->subdevices[3];
|
||||
/* eeprom subdevice */
|
||||
/* s->type=COMEDI_SUBD_EEPROM; */
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
|
||||
atao_reset(dev);
|
||||
|
||||
printk(KERN_INFO "\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user