summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-03-03 16:47:37 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-04 16:40:27 -0800
commit89d9dcd0a42a4978e203974fc7b0bf307c05b8a7 (patch)
treed2a96d1014f7a4034fff53bb7e90692736673a1f /drivers/staging
parent4761fb4e4a97a512983e5cff422ef64e0c164454 (diff)
staging: comedi: ke_counter: tidy up the subdevice init
For aesthetics, add some whitespace to the subdevice init. This driver does not support async commands so remove the dev->read_subdev initialization. Remove the commented out SDF_COMMON from the subdevice subev_flags. Add the subdevice range_table initialization. For aesthetics, rename the (*insn_{read,write}) functions so they have namespace associated with the driver. Remove the unnecessary comments about the (*insn_{read,write}) functions. 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')
-rw-r--r--drivers/staging/comedi/drivers/ke_counter.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/staging/comedi/drivers/ke_counter.c b/drivers/staging/comedi/drivers/ke_counter.c
index 17cba90dfb39..e751482aef19 100644
--- a/drivers/staging/comedi/drivers/ke_counter.c
+++ b/drivers/staging/comedi/drivers/ke_counter.c
@@ -49,13 +49,10 @@ Kolter Electronic PCI Counter Card.
#define KE_OSC_SEL_20MHZ (3 << 0)
#define KE_DO_REG 0xfc
-/*-- counter write ----------------------------------------------------------*/
-
-/* This should be used only for resetting the counters; maybe it is better
- to make a special command 'reset'. */
-static int cnt_winsn(struct comedi_device *dev,
- struct comedi_subdevice *s, struct comedi_insn *insn,
- unsigned int *data)
+static int ke_counter_insn_write(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
@@ -72,11 +69,10 @@ static int cnt_winsn(struct comedi_device *dev,
return 1;
}
-/*-- counter read -----------------------------------------------------------*/
-
-static int cnt_rinsn(struct comedi_device *dev,
- struct comedi_subdevice *s, struct comedi_insn *insn,
- unsigned int *data)
+static int ke_counter_insn_read(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
{
unsigned char a0, a1, a2, a3, a4;
int chan = CR_CHAN(insn->chanspec);
@@ -115,14 +111,13 @@ static int cnt_auto_attach(struct comedi_device *dev,
return ret;
s = &dev->subdevices[0];
- dev->read_subdev = s;
-
- s->type = COMEDI_SUBD_COUNTER;
- s->subdev_flags = SDF_READABLE /* | SDF_COMMON */ ;
- s->n_chan = 3;
- s->maxdata = 0x00ffffff;
- s->insn_read = cnt_rinsn;
- s->insn_write = cnt_winsn;
+ s->type = COMEDI_SUBD_COUNTER;
+ s->subdev_flags = SDF_READABLE;
+ s->n_chan = 3;
+ s->maxdata = 0x00ffffff;
+ s->range_table = &range_unknown;
+ s->insn_read = ke_counter_insn_read;
+ s->insn_write = ke_counter_insn_write;
outb(KE_OSC_SEL_20MHZ, dev->iobase + KE_OSC_SEL_REG);