Commit 10f74377 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_tio: make ni_tio_winsn() a proper comedi (*insn_write)

Change the parameters to ni_tio_winsn() to make it a proper comedi
(*insn_write) function. This allows using it directly and removing the
wrapper functions in the ni_660x and ni_mio_common modules.

For aesthetics, rename the function.
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 9014d816
......@@ -1002,15 +1002,6 @@ ni_660x_GPCT_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
return ni_tio_insn_config(counter, insn, data);
}
static int ni_660x_GPCT_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct ni_gpct *counter = s->private;
return ni_tio_winsn(counter, insn, data);
}
static int ni_660x_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
......@@ -1233,7 +1224,7 @@ static int ni_660x_auto_attach(struct comedi_device *dev,
s->n_chan = 3;
s->maxdata = 0xffffffff;
s->insn_read = ni_tio_insn_read;
s->insn_write = ni_660x_GPCT_winsn;
s->insn_write = ni_tio_insn_write;
s->insn_config = ni_660x_GPCT_insn_config;
s->do_cmd = &ni_660x_cmd;
s->len_chanlist = 1;
......
......@@ -276,9 +276,6 @@ static int ni_ao_reset(struct comedi_device *dev, struct comedi_subdevice *s);
static int ni_8255_callback(int dir, int port, int data, unsigned long arg);
static int ni_gpct_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int ni_gpct_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
......@@ -4443,7 +4440,7 @@ static int ni_E_init(struct comedi_device *dev)
else
s->maxdata = 0xffffff;
s->insn_read = ni_tio_insn_read;
s->insn_write = &ni_gpct_insn_write;
s->insn_write = ni_tio_insn_read;
s->insn_config = &ni_gpct_insn_config;
#ifdef PCIDMA
s->subdev_flags |= SDF_CMD_READ /* | SDF_CMD_WRITE */;
......@@ -5020,14 +5017,6 @@ static int ni_gpct_insn_config(struct comedi_device *dev,
return ni_tio_insn_config(counter, insn, data);
}
static int ni_gpct_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct ni_gpct *counter = s->private;
return ni_tio_winsn(counter, insn, data);
}
#ifdef PCIDMA
static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{
......
......@@ -1638,9 +1638,12 @@ static unsigned ni_tio_next_load_register(struct ni_gpct *counter)
return NITIO_LOADA_REG(cidx);
}
int ni_tio_winsn(struct ni_gpct *counter, struct comedi_insn *insn,
unsigned int *data)
int ni_tio_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
struct ni_gpct *counter = s->private;
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned channel = CR_CHAN(insn->chanspec);
unsigned cidx = counter->counter_index;
......@@ -1673,7 +1676,7 @@ int ni_tio_winsn(struct ni_gpct *counter, struct comedi_insn *insn,
}
return 0;
}
EXPORT_SYMBOL_GPL(ni_tio_winsn);
EXPORT_SYMBOL_GPL(ni_tio_insn_write);
static int __init ni_tio_init_module(void)
{
......
......@@ -141,7 +141,8 @@ int ni_tio_insn_read(struct comedi_device *, struct comedi_subdevice *,
struct comedi_insn *, unsigned int *data);
int ni_tio_insn_config(struct ni_gpct *, struct comedi_insn *,
unsigned int *data);
int ni_tio_winsn(struct ni_gpct *, struct comedi_insn *, unsigned int *data);
int ni_tio_insn_write(struct comedi_device *, struct comedi_subdevice *,
struct comedi_insn *, unsigned int *data);
int ni_tio_cmd(struct ni_gpct *, struct comedi_async *);
int ni_tio_cmdtest(struct ni_gpct *, struct comedi_cmd *);
int ni_tio_cancel(struct ni_gpct *);
......
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