]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: ni_mio_common: remove forward declaration 16
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 28 May 2014 23:26:39 +0000 (16:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:33:52 +0000 (14:33 -0700)
Move ni_ai_insn_config() to remove the need for a forward declaration.

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 d520417fc0dc6611ec981ca4e1e79b44ca426723..65c20c98dd9452c2930f68846d2e300cef2a4dd0 100644 (file)
@@ -2461,66 +2461,6 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
        return 0;
 }
 
-static int ni_ai_config_analog_trig(struct comedi_device *dev,
-                                   struct comedi_subdevice *s,
-                                   struct comedi_insn *insn,
-                                   unsigned int *data);
-
-static int ni_ai_insn_config(struct comedi_device *dev,
-                            struct comedi_subdevice *s,
-                            struct comedi_insn *insn, unsigned int *data)
-{
-       const struct ni_board_struct *board = comedi_board(dev);
-       struct ni_private *devpriv = dev->private;
-
-       if (insn->n < 1)
-               return -EINVAL;
-
-       switch (data[0]) {
-       case INSN_CONFIG_ANALOG_TRIG:
-               return ni_ai_config_analog_trig(dev, s, insn, data);
-       case INSN_CONFIG_ALT_SOURCE:
-               if (board->reg_type & ni_reg_m_series_mask) {
-                       if (data[1] & ~(MSeries_AI_Bypass_Cal_Sel_Pos_Mask |
-                                       MSeries_AI_Bypass_Cal_Sel_Neg_Mask |
-                                       MSeries_AI_Bypass_Mode_Mux_Mask |
-                                       MSeries_AO_Bypass_AO_Cal_Sel_Mask)) {
-                               return -EINVAL;
-                       }
-                       devpriv->ai_calib_source = data[1];
-               } else if (board->reg_type == ni_reg_6143) {
-                       unsigned int calib_source;
-
-                       calib_source = data[1] & 0xf;
-
-                       if (calib_source > 0xF)
-                               return -EINVAL;
-
-                       devpriv->ai_calib_source = calib_source;
-                       ni_writew(calib_source, Calibration_Channel_6143);
-               } else {
-                       unsigned int calib_source;
-                       unsigned int calib_source_adjust;
-
-                       calib_source = data[1] & 0xf;
-                       calib_source_adjust = (data[1] >> 4) & 0xff;
-
-                       if (calib_source >= 8)
-                               return -EINVAL;
-                       devpriv->ai_calib_source = calib_source;
-                       if (board->reg_type == ni_reg_611x) {
-                               ni_writeb(calib_source_adjust,
-                                         Cal_Gain_Select_611x);
-                       }
-               }
-               return 2;
-       default:
-               break;
-       }
-
-       return -EINVAL;
-}
-
 static int ni_ai_config_analog_trig(struct comedi_device *dev,
                                    struct comedi_subdevice *s,
                                    struct comedi_insn *insn,
@@ -2621,6 +2561,61 @@ static int ni_ai_config_analog_trig(struct comedi_device *dev,
        return 5;
 }
 
+static int ni_ai_insn_config(struct comedi_device *dev,
+                            struct comedi_subdevice *s,
+                            struct comedi_insn *insn, unsigned int *data)
+{
+       const struct ni_board_struct *board = comedi_board(dev);
+       struct ni_private *devpriv = dev->private;
+
+       if (insn->n < 1)
+               return -EINVAL;
+
+       switch (data[0]) {
+       case INSN_CONFIG_ANALOG_TRIG:
+               return ni_ai_config_analog_trig(dev, s, insn, data);
+       case INSN_CONFIG_ALT_SOURCE:
+               if (board->reg_type & ni_reg_m_series_mask) {
+                       if (data[1] & ~(MSeries_AI_Bypass_Cal_Sel_Pos_Mask |
+                                       MSeries_AI_Bypass_Cal_Sel_Neg_Mask |
+                                       MSeries_AI_Bypass_Mode_Mux_Mask |
+                                       MSeries_AO_Bypass_AO_Cal_Sel_Mask)) {
+                               return -EINVAL;
+                       }
+                       devpriv->ai_calib_source = data[1];
+               } else if (board->reg_type == ni_reg_6143) {
+                       unsigned int calib_source;
+
+                       calib_source = data[1] & 0xf;
+
+                       if (calib_source > 0xF)
+                               return -EINVAL;
+
+                       devpriv->ai_calib_source = calib_source;
+                       ni_writew(calib_source, Calibration_Channel_6143);
+               } else {
+                       unsigned int calib_source;
+                       unsigned int calib_source_adjust;
+
+                       calib_source = data[1] & 0xf;
+                       calib_source_adjust = (data[1] >> 4) & 0xff;
+
+                       if (calib_source >= 8)
+                               return -EINVAL;
+                       devpriv->ai_calib_source = calib_source;
+                       if (board->reg_type == ni_reg_611x) {
+                               ni_writeb(calib_source_adjust,
+                                         Cal_Gain_Select_611x);
+                       }
+               }
+               return 2;
+       default:
+               break;
+       }
+
+       return -EINVAL;
+}
+
 /* munge data from unsigned to 2's complement for analog output bipolar modes */
 static void ni_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s,
                        void *data, unsigned int num_bytes,