Commit 5c8694d6 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: das16m1: tidy up analog input subdevice init

Add some whitespace to the subdevice init and rename the support
functions.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a7061589
...@@ -163,8 +163,9 @@ static int das16m1_ai_check_chanlist(struct comedi_device *dev, ...@@ -163,8 +163,9 @@ static int das16m1_ai_check_chanlist(struct comedi_device *dev,
return 0; return 0;
} }
static int das16m1_cmd_test(struct comedi_device *dev, static int das16m1_ai_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd) struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ {
int err = 0; int err = 0;
...@@ -234,7 +235,7 @@ static int das16m1_cmd_test(struct comedi_device *dev, ...@@ -234,7 +235,7 @@ static int das16m1_cmd_test(struct comedi_device *dev,
return 0; return 0;
} }
static int das16m1_cmd_exec(struct comedi_device *dev, static int das16m1_ai_cmd(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct das16m1_private_struct *devpriv = dev->private; struct das16m1_private_struct *devpriv = dev->private;
...@@ -291,7 +292,8 @@ static int das16m1_cmd_exec(struct comedi_device *dev, ...@@ -291,7 +292,8 @@ static int das16m1_cmd_exec(struct comedi_device *dev,
return 0; return 0;
} }
static int das16m1_cancel(struct comedi_device *dev, struct comedi_subdevice *s) static int das16m1_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{ {
struct das16m1_private_struct *devpriv = dev->private; struct das16m1_private_struct *devpriv = dev->private;
...@@ -316,9 +318,10 @@ static int das16m1_ai_eoc(struct comedi_device *dev, ...@@ -316,9 +318,10 @@ static int das16m1_ai_eoc(struct comedi_device *dev,
return -EBUSY; return -EBUSY;
} }
static int das16m1_ai_rinsn(struct comedi_device *dev, static int das16m1_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn,
unsigned int *data)
{ {
int ret; int ret;
int n; int n;
...@@ -437,7 +440,8 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status) ...@@ -437,7 +440,8 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
comedi_handle_events(dev, s); comedi_handle_events(dev, s);
} }
static int das16m1_poll(struct comedi_device *dev, struct comedi_subdevice *s) static int das16m1_ai_poll(struct comedi_device *dev,
struct comedi_subdevice *s)
{ {
unsigned long flags; unsigned long flags;
unsigned int status; unsigned int status;
...@@ -552,22 +556,22 @@ static int das16m1_attach(struct comedi_device *dev, ...@@ -552,22 +556,22 @@ static int das16m1_attach(struct comedi_device *dev,
if (ret) if (ret)
return ret; return ret;
/* Analog Input subdevice */
s = &dev->subdevices[0]; s = &dev->subdevices[0];
/* ai */
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_DIFF; s->subdev_flags = SDF_READABLE | SDF_DIFF;
s->n_chan = 8; s->n_chan = 8;
s->maxdata = (1 << 12) - 1; s->maxdata = 0x0fff;
s->range_table = &range_das16m1; s->range_table = &range_das16m1;
s->insn_read = das16m1_ai_rinsn; s->insn_read = das16m1_ai_insn_read;
if (dev->irq) { if (dev->irq) {
dev->read_subdev = s; dev->read_subdev = s;
s->subdev_flags |= SDF_CMD_READ; s->subdev_flags |= SDF_CMD_READ;
s->len_chanlist = 256; s->len_chanlist = 256;
s->do_cmdtest = das16m1_cmd_test; s->do_cmdtest = das16m1_ai_cmdtest;
s->do_cmd = das16m1_cmd_exec; s->do_cmd = das16m1_ai_cmd;
s->cancel = das16m1_cancel; s->cancel = das16m1_ai_cancel;
s->poll = das16m1_poll; s->poll = das16m1_ai_poll;
} }
s = &dev->subdevices[1]; s = &dev->subdevices[1];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment