staging: comedi: ni_mio_common: remove forward declaration 6
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 28 May 2014 23:26:29 +0000 (16:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:33:51 +0000 (14:33 -0700)
Move the ni_gpct_cmd() and ni_gpct_cancel() functions to remove the
need for the forward declarations.

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>
drivers/staging/comedi/drivers/ni_mio_common.c

index 0bce283eb72b87e13a5c1e8183159fd6aa9f8d34..2b997ef0f97c7882aa4f4a09268d80cc9fce021c 100644 (file)
@@ -253,10 +253,6 @@ static void shutdown_ai_command(struct comedi_device *dev);
 static int ni_ao_inttrig(struct comedi_device *dev, struct comedi_subdevice *s,
                         unsigned int trignum);
 
-#ifdef PCIDMA
-static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
-static int ni_gpct_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
-#endif
 static void handle_gpct_interrupt(struct comedi_device *dev,
                                  unsigned short counter_index);
 
@@ -4514,6 +4510,37 @@ static int ni_m_series_eeprom_insn_read(struct comedi_device *dev,
        return 1;
 }
 
+#ifdef PCIDMA
+static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
+{
+       struct ni_gpct *counter = s->private;
+       int retval;
+
+       retval = ni_request_gpct_mite_channel(dev, counter->counter_index,
+                                             COMEDI_INPUT);
+       if (retval) {
+               comedi_error(dev,
+                            "no dma channel available for use by counter");
+               return retval;
+       }
+       ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
+       ni_e_series_enable_second_irq(dev, counter->counter_index, 1);
+
+       return ni_tio_cmd(dev, s);
+}
+
+static int ni_gpct_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
+{
+       struct ni_gpct *counter = s->private;
+       int retval;
+
+       retval = ni_tio_cancel(counter);
+       ni_e_series_enable_second_irq(dev, counter->counter_index, 0);
+       ni_release_gpct_mite_channel(dev, counter->counter_index);
+       return retval;
+}
+#endif
+
 static int ni_E_init(struct comedi_device *dev)
 {
        const struct ni_board_struct *board = comedi_board(dev);
@@ -4933,39 +4960,6 @@ static void GPCT_Reset(struct comedi_device *dev, int chan)
 
 #endif
 
-#ifdef PCIDMA
-static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
-{
-       struct ni_gpct *counter = s->private;
-       int retval;
-
-       retval = ni_request_gpct_mite_channel(dev, counter->counter_index,
-                                             COMEDI_INPUT);
-       if (retval) {
-               comedi_error(dev,
-                            "no dma channel available for use by counter");
-               return retval;
-       }
-       ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
-       ni_e_series_enable_second_irq(dev, counter->counter_index, 1);
-
-       return ni_tio_cmd(dev, s);
-}
-#endif
-
-#ifdef PCIDMA
-static int ni_gpct_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
-{
-       struct ni_gpct *counter = s->private;
-       int retval;
-
-       retval = ni_tio_cancel(counter);
-       ni_e_series_enable_second_irq(dev, counter->counter_index, 0);
-       ni_release_gpct_mite_channel(dev, counter->counter_index);
-       return retval;
-}
-#endif
-
 /*
  *
  *  Programmable Function Inputs