From 32d39862be8ff3b098e56cbb0d667f76df015948 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 25 Oct 2012 15:08:25 -0700 Subject: [PATCH] staging: comedi: me_daq: cleanup the boardinfo Rename the boardinfo variables so they are a bit more concise. Remove the unnecessary comments in the boardinfo. Add some whitespace to make the code more readable. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/me_daq.c | 67 ++++++++++++------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c index 6a8b2c966c4b..7e8f4d6cf115 100644 --- a/drivers/staging/comedi/drivers/me_daq.c +++ b/drivers/staging/comedi/drivers/me_daq.c @@ -172,39 +172,34 @@ static const struct comedi_lrange me2600_ao_range = { } }; -/* Board specification structure */ struct me_board { - const char *name; /* driver name */ + const char *name; int device_id; - int ao_channel_nbr; /* DA config */ - int ao_resolution; - const struct comedi_lrange *ao_range_list; - int ai_channel_nbr; /* AD config */ - int ai_resolution; - const struct comedi_lrange *ai_range_list; + int ao_chans; + int ao_bits; + const struct comedi_lrange *ao_range; + int ai_chans; + int ai_bits; + const struct comedi_lrange *ai_range; }; static const struct me_board me_boards[] = { { - .name = "me-2600i", - .device_id = ME2600_DEVICE_ID, - /* Analog Output */ - .ao_channel_nbr = 4, - .ao_resolution = 12, - .ao_range_list = &me2600_ao_range, - .ai_channel_nbr = 16, - /* Analog Input */ - .ai_resolution = 12, - .ai_range_list = &me2600_ai_range, - }, - { - .name = "me-2000i", - .device_id = ME2000_DEVICE_ID, - .ai_channel_nbr = 16, - /* Analog Input */ - .ai_resolution = 12, - .ai_range_list = &me2000_ai_range, - } + .name = "me-2600i", + .device_id = ME2600_DEVICE_ID, + .ao_chans = 4, + .ao_bits = 12, + .ao_range = &me2600_ao_range, + .ai_chans = 16, + .ai_bits = 12, + .ai_range = &me2600_ai_range, + }, { + .name = "me-2000i", + .device_id = ME2000_DEVICE_ID, + .ai_chans = 16, + .ai_bits = 12, + .ai_range = &me2000_ai_range, + } }; /* Private data structure */ @@ -712,23 +707,23 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) s = &dev->subdevices[0]; s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_CMD_READ; - s->n_chan = board->ai_channel_nbr; - s->maxdata = (1 << board->ai_resolution) - 1; - s->len_chanlist = board->ai_channel_nbr; - s->range_table = board->ai_range_list; + s->n_chan = board->ai_chans; + s->maxdata = (1 << board->ai_bits) - 1; + s->len_chanlist = board->ai_chans; + s->range_table = board->ai_range; s->cancel = me_ai_cancel; s->insn_read = me_ai_insn_read; s->do_cmdtest = me_ai_do_cmd_test; s->do_cmd = me_ai_do_cmd; s = &dev->subdevices[1]; - if (board->ao_channel_nbr) { + if (board->ao_chans) { s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITEABLE | SDF_COMMON; - s->n_chan = board->ao_channel_nbr; - s->maxdata = (1 << board->ao_resolution) - 1; - s->len_chanlist = board->ao_channel_nbr; - s->range_table = board->ao_range_list; + s->n_chan = board->ao_chans; + s->maxdata = (1 << board->ao_bits) - 1; + s->len_chanlist = board->ao_chans; + s->range_table = board->ao_range; s->insn_read = me_ao_insn_read; s->insn_write = me_ao_insn_write; } else { -- 2.20.1