summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-01-23 12:43:14 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-25 12:00:30 -0800
commit015aebe78d3f341fc6aa42f655e191f84bd1a7e5 (patch)
treeceb4f144521f9cf15a94cc851b648abdf170bbda
parent694dcf501c35b6afcbc90ae3b4f3fea0b59f9888 (diff)
staging: comedi: addi_apci_3501: remove dependency on addi_common.h
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>
-rw-r--r--drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c10
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_3501.c26
2 files changed, 19 insertions, 17 deletions
diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
index 41a3477c153..f7098533d16 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
@@ -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] =
diff --git a/drivers/staging/comedi/drivers/addi_apci_3501.c b/drivers/staging/comedi/drivers/addi_apci_3501.c
index 6e331d4330a..d345daa00f4 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3501.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3501.c
@@ -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);