staging: comedi: ni_tiocmd: make ni_tio_cmdtest() a proper comedi (*do_cmdtest)

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

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten 2013-12-19 16:32:03 -07:00 committed by Greg Kroah-Hartman
parent cac04c0f68
commit c3f3b431de
4 changed files with 8 additions and 25 deletions

View File

@ -830,14 +830,6 @@ static int ni_660x_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
return retval; return retval;
} }
static int ni_660x_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
struct ni_gpct *counter = s->private;
return ni_tio_cmdtest(counter, cmd);
}
static int ni_660x_cancel(struct comedi_device *dev, struct comedi_subdevice *s) static int ni_660x_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
struct ni_gpct *counter = s->private; struct ni_gpct *counter = s->private;
@ -1219,7 +1211,7 @@ static int ni_660x_auto_attach(struct comedi_device *dev,
s->insn_config = ni_tio_insn_config; s->insn_config = ni_tio_insn_config;
s->do_cmd = &ni_660x_cmd; s->do_cmd = &ni_660x_cmd;
s->len_chanlist = 1; s->len_chanlist = 1;
s->do_cmdtest = &ni_660x_cmdtest; s->do_cmdtest = ni_tio_cmdtest;
s->cancel = &ni_660x_cancel; s->cancel = &ni_660x_cancel;
s->poll = &ni_660x_input_poll; s->poll = &ni_660x_input_poll;
s->async_dma_dir = DMA_BIDIRECTIONAL; s->async_dma_dir = DMA_BIDIRECTIONAL;

View File

@ -278,8 +278,6 @@ static int ni_8255_callback(int dir, int port, int data, unsigned long arg);
#ifdef PCIDMA #ifdef PCIDMA
static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s); static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
static int ni_gpct_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd);
#endif #endif
static int ni_gpct_cancel(struct comedi_device *dev, static int ni_gpct_cancel(struct comedi_device *dev,
struct comedi_subdevice *s); struct comedi_subdevice *s);
@ -4443,7 +4441,7 @@ static int ni_E_init(struct comedi_device *dev)
s->subdev_flags |= SDF_CMD_READ /* | SDF_CMD_WRITE */; s->subdev_flags |= SDF_CMD_READ /* | SDF_CMD_WRITE */;
s->do_cmd = &ni_gpct_cmd; s->do_cmd = &ni_gpct_cmd;
s->len_chanlist = 1; s->len_chanlist = 1;
s->do_cmdtest = &ni_gpct_cmdtest; s->do_cmdtest = ni_tio_cmdtest;
s->cancel = &ni_gpct_cancel; s->cancel = &ni_gpct_cancel;
s->async_dma_dir = DMA_BIDIRECTIONAL; s->async_dma_dir = DMA_BIDIRECTIONAL;
#endif #endif
@ -5027,17 +5025,6 @@ static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
} }
#endif #endif
#ifdef PCIDMA
static int ni_gpct_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
struct ni_gpct *counter = s->private;
return ni_tio_cmdtest(counter, cmd);
return -ENOTSUPP;
}
#endif
static int ni_gpct_cancel(struct comedi_device *dev, struct comedi_subdevice *s) static int ni_gpct_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
#ifdef PCIDMA #ifdef PCIDMA

View File

@ -144,7 +144,8 @@ int ni_tio_insn_config(struct comedi_device *, struct comedi_subdevice *,
int ni_tio_insn_write(struct comedi_device *, struct comedi_subdevice *, int ni_tio_insn_write(struct comedi_device *, struct comedi_subdevice *,
struct comedi_insn *, unsigned int *data); struct comedi_insn *, unsigned int *data);
int ni_tio_cmd(struct ni_gpct *, struct comedi_async *); int ni_tio_cmd(struct ni_gpct *, struct comedi_async *);
int ni_tio_cmdtest(struct ni_gpct *, struct comedi_cmd *); int ni_tio_cmdtest(struct comedi_device *, struct comedi_subdevice *,
struct comedi_cmd *);
int ni_tio_cancel(struct ni_gpct *); int ni_tio_cancel(struct ni_gpct *);
void ni_tio_handle_interrupt(struct ni_gpct *, struct comedi_subdevice *); void ni_tio_handle_interrupt(struct ni_gpct *, struct comedi_subdevice *);
void ni_tio_set_mite_channel(struct ni_gpct *, struct mite_channel *); void ni_tio_set_mite_channel(struct ni_gpct *, struct mite_channel *);

View File

@ -228,8 +228,11 @@ int ni_tio_cmd(struct ni_gpct *counter, struct comedi_async *async)
} }
EXPORT_SYMBOL_GPL(ni_tio_cmd); EXPORT_SYMBOL_GPL(ni_tio_cmd);
int ni_tio_cmdtest(struct ni_gpct *counter, struct comedi_cmd *cmd) int ni_tio_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ {
struct ni_gpct *counter = s->private;
int err = 0; int err = 0;
unsigned int sources; unsigned int sources;