diff options
| author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-06-05 15:37:33 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 12:01:34 -0700 |
| commit | 624b653090974a84f89260b0882286d817a185b4 (patch) | |
| tree | 4429d0341e7fe8ad18f092747974f80a313b9df8 | |
| parent | 3275b4d3db1f087c67fa115b150a9d2f9d8429f9 (diff) | |
staging: comedi: pcmad: tidy up pcmad_attach()
Remove the comment before the function, the options are documented at
the beginning of the file.
Remove the PCMAD_SIZE define. It's only used in the attach to specify
the io region size.
For aesthetic reasons, add some whitespace to the subdevice init and
reorder them a bit.
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>
| -rw-r--r-- | drivers/staging/comedi/drivers/pcmad.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c index 6b31e43335cc..76799ceac033 100644 --- a/drivers/staging/comedi/drivers/pcmad.c +++ b/drivers/staging/comedi/drivers/pcmad.c @@ -43,8 +43,6 @@ #include <linux/ioport.h> -#define PCMAD_SIZE 4 - #define PCMAD_STATUS 0 #define PCMAD_LSB 1 #define PCMAD_MSB 2 @@ -114,13 +112,6 @@ static int pcmad_ai_insn_read(struct comedi_device *dev, return insn->n; } -/* - * options: - * 0 i/o base - * 1 unused - * 2 0=single ended 1=differential - * 3 0=straight binary 1=two's comp - */ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) { const struct pcmad_board_struct *board = comedi_board(dev); @@ -128,7 +119,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct comedi_subdevice *s; int ret; - ret = comedi_request_region(dev, it->options[0], PCMAD_SIZE); + ret = comedi_request_region(dev, it->options[0], 0x04); if (ret) return ret; @@ -142,13 +133,13 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) dev->private = devpriv; s = &dev->subdevices[0]; - s->type = COMEDI_SUBD_AI; - s->subdev_flags = SDF_READABLE | AREF_GROUND; - s->n_chan = 16; /* XXX */ - s->len_chanlist = 1; - s->insn_read = pcmad_ai_insn_read; - s->maxdata = (1 << board->n_ai_bits) - 1; - s->range_table = &range_unknown; + s->type = COMEDI_SUBD_AI; + s->subdev_flags = SDF_READABLE | AREF_GROUND; + s->n_chan = 16; + s->len_chanlist = 1; + s->maxdata = (1 << board->n_ai_bits) - 1; + s->range_table = &range_unknown; + s->insn_read = pcmad_ai_insn_read; return 0; } |
