[PATCH 26/31] staging: comedi: ni_mio_common: move externally called functions to EOF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This source file is included by the ni_atmio, ni_mio_cs, and ni_pcmio
drivers to support the common hardware on National Instruments DAQ-STC
based boards.

The only functions actually used by the external source files are
ni_E_interrupt(), ni_alloc_private(), ni_E_init(), and mio_common_detach().
The rest of the functions in this file are only used locally.

For aesthetics, move all the externally called functions to the end of
the file.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 50 +++++++++++++-------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index 556e885..8b2178a 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -3673,16 +3673,6 @@ static int ni_serial_insn_config(struct comedi_device *dev,
 
 }
 
-static void mio_common_detach(struct comedi_device *dev)
-{
-	struct ni_private *devpriv = dev->private;
-
-	if (devpriv) {
-		if (devpriv->counter_dev)
-			ni_gpct_device_destroy(devpriv->counter_dev);
-	}
-}
-
 static void init_ao_67xx(struct comedi_device *dev, struct comedi_subdevice *s)
 {
 	int i;
@@ -3965,21 +3955,6 @@ static int ni_freq_out_insn_config(struct comedi_device *dev,
 	return -EINVAL;
 }
 
-static int ni_alloc_private(struct comedi_device *dev)
-{
-	struct ni_private *devpriv;
-
-	devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
-	if (!devpriv)
-		return -ENOMEM;
-
-	spin_lock_init(&devpriv->window_lock);
-	spin_lock_init(&devpriv->soft_reg_copy_lock);
-	spin_lock_init(&devpriv->mite_channel_lock);
-
-	return 0;
-};
-
 static int ni_8255_callback(int dir, int port, int data, unsigned long arg)
 {
 	struct comedi_device *dev = (struct comedi_device *)arg;
@@ -5267,6 +5242,21 @@ static irqreturn_t ni_E_interrupt(int irq, void *d)
 	return IRQ_HANDLED;
 }
 
+static int ni_alloc_private(struct comedi_device *dev)
+{
+	struct ni_private *devpriv;
+
+	devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
+	if (!devpriv)
+		return -ENOMEM;
+
+	spin_lock_init(&devpriv->window_lock);
+	spin_lock_init(&devpriv->soft_reg_copy_lock);
+	spin_lock_init(&devpriv->mite_channel_lock);
+
+	return 0;
+}
+
 static int ni_E_init(struct comedi_device *dev)
 {
 	const struct ni_board_struct *board = comedi_board(dev);
@@ -5596,3 +5586,13 @@ static int ni_E_init(struct comedi_device *dev)
 
 	return 0;
 }
+
+static void mio_common_detach(struct comedi_device *dev)
+{
+	struct ni_private *devpriv = dev->private;
+
+	if (devpriv) {
+		if (devpriv->counter_dev)
+			ni_gpct_device_destroy(devpriv->counter_dev);
+	}
+}
-- 
1.9.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux