staging: comedi: addi_apci_3501: remove dependency on addi_common.h
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 23 Jan 2013 19:43:14 +0000 (12:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2013 20:00:30 +0000 (12:00 -0800)
Create a struct to hold the private data still used by this driver.
This removes the last dependencies on the addi-data "common" code
so we can also remove the #include of addi_common.h.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
drivers/staging/comedi/drivers/addi_apci_3501.c

index 41a3477c153ed62ff915fe5cf2e1cc25f1ce76ed..f7098533d16a15c98f3499685c84ba8c3c6a0392 100644 (file)
@@ -115,7 +115,7 @@ static int i_APCI3501_ConfigAnalogOutput(struct comedi_device *dev,
                                         struct comedi_insn *insn,
                                         unsigned int *data)
 {
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
 
        outl(data[0],
                dev->iobase + APCI3501_ANALOG_OUTPUT +
@@ -157,7 +157,7 @@ static int i_APCI3501_WriteAnalogOutput(struct comedi_device *dev,
                                        struct comedi_insn *insn,
                                        unsigned int *data)
 {
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
        unsigned int ul_Command1 = 0, ul_Channel_no, ul_Polarity, ul_DAC_Ready = 0;
 
        ul_Channel_no = CR_CHAN(insn->chanspec);
@@ -234,7 +234,7 @@ static int i_APCI3501_ConfigTimerCounterWatchdog(struct comedi_device *dev,
                                                 struct comedi_insn *insn,
                                                 unsigned int *data)
 {
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
        unsigned int ul_Command1 = 0;
 
        devpriv->tsk_Current = current;
@@ -339,7 +339,7 @@ static int i_APCI3501_StartStopWriteTimerCounterWatchdog(struct comedi_device *d
                                                         struct comedi_insn *insn,
                                                         unsigned int *data)
 {
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
        unsigned int ul_Command1 = 0;
        int i_Temp;
 
@@ -445,7 +445,7 @@ static int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device *dev,
                                               struct comedi_insn *insn,
                                               unsigned int *data)
 {
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
 
        if (devpriv->b_TimerSelectMode == ADDIDATA_WATCHDOG) {
                data[0] =
index 6e331d4330af08475c98900c34a9093bb2f0bdad..d345daa00f482d67b5c046f01d18844b0e2644f4 100644 (file)
@@ -2,7 +2,12 @@
 #include "comedi_fc.h"
 #include "amcc_s5933.h"
 
-#include "addi-data/addi_common.h"
+struct apci3501_private {
+       int i_IobaseAmcc;
+       struct task_struct *tsk_Current;
+       unsigned char b_TimerSelectMode;
+       unsigned char b_InterruptMode;
+};
 
 #include "addi-data/hwdrv_apci3501.c"
 
@@ -107,7 +112,7 @@ static unsigned short apci3501_eeprom_readw(unsigned long iobase,
 
 static int apci3501_eeprom_get_ao_n_chan(struct comedi_device *dev)
 {
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
        unsigned long iobase = devpriv->i_IobaseAmcc;
        unsigned char nfuncs;
        int i;
@@ -137,7 +142,7 @@ static int apci3501_eeprom_insn_read(struct comedi_device *dev,
                                     struct comedi_insn *insn,
                                     unsigned int *data)
 {
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
        unsigned short addr = CR_CHAN(insn->chanspec);
 
        data[0] = apci3501_eeprom_readw(devpriv->i_IobaseAmcc, 2 * addr);
@@ -148,7 +153,7 @@ static int apci3501_eeprom_insn_read(struct comedi_device *dev,
 static irqreturn_t apci3501_interrupt(int irq, void *d)
 {
        struct comedi_device *dev = d;
-       struct addi_private *devpriv = dev->private;
+       struct apci3501_private *devpriv = dev->private;
        unsigned int ui_Timer_AOWatchdog;
        unsigned long ul_Command1;
        int i_temp;
@@ -222,7 +227,7 @@ static int apci3501_auto_attach(struct comedi_device *dev,
                                unsigned long context_unused)
 {
        struct pci_dev *pcidev = comedi_to_pci_dev(dev);
-       struct addi_private *devpriv;
+       struct apci3501_private *devpriv;
        struct comedi_subdevice *s;
        int ao_n_chan;
        int ret;
@@ -313,14 +318,11 @@ static int apci3501_auto_attach(struct comedi_device *dev,
 static void apci3501_detach(struct comedi_device *dev)
 {
        struct pci_dev *pcidev = comedi_to_pci_dev(dev);
-       struct addi_private *devpriv = dev->private;
 
-       if (devpriv) {
-               if (dev->iobase)
-                       apci3501_reset(dev);
-               if (dev->irq)
-                       free_irq(dev->irq, dev);
-       }
+       if (dev->iobase)
+               apci3501_reset(dev);
+       if (dev->irq)
+               free_irq(dev->irq, dev);
        if (pcidev) {
                if (dev->iobase)
                        comedi_pci_disable(pcidev);