From 1867add98e44d4bec01572b4cfd4becd11297e5d Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 12 Jun 2013 16:10:37 -0700 Subject: [PATCH] staging: comedi: addi_apci_3xxx: introduce a local private data definition The struct addi_private definition from the addi-data "common" code is very bloated. Introduce a local struct apci3xxx_private that just has the data needed by this driver. Add a couple includes that this driver depends on and remove the include of "addi-data/addi_common.h" since this driver no longer depends on it. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci3xxx.c | 16 +++++------ drivers/staging/comedi/drivers/addi_apci_3xxx.c | 31 ++++++++++++++++------ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c index ef83ed4..8ce552e 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c @@ -73,7 +73,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY */ static int i_APCI3XXX_TestConversionStarted(struct comedi_device *dev) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; if ((readl(devpriv->dw_AiBase + 8) & 0x80000UL) == 0x80000UL) return 1; @@ -115,7 +115,7 @@ static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev, unsigned int *data) { const struct apci3xxx_boardinfo *this_board = comedi_board(dev); - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; int i_ReturnValue = insn->n; unsigned char b_TimeBase = 0; unsigned char b_SingleDiff = 0; @@ -366,7 +366,7 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev, unsigned int *data) { const struct apci3xxx_boardinfo *this_board = comedi_board(dev); - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; int i_ReturnValue = insn->n; unsigned char b_Configuration = (unsigned char) CR_RANGE(insn->chanspec); unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); @@ -596,7 +596,7 @@ static int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device *dev, unsigned int *data) { const struct apci3xxx_boardinfo *board = comedi_board(dev); - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; unsigned char b_Range = (unsigned char) CR_RANGE(insn->chanspec); unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); unsigned int dw_Status = 0; @@ -701,7 +701,7 @@ static int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; int i_ReturnValue = insn->n; unsigned char b_Command = 0; @@ -831,7 +831,7 @@ static int i_APCI3XXX_InsnBitsTTLIO(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; int i_ReturnValue = insn->n; unsigned char b_ChannelCpt = 0; unsigned int dw_ChannelMask = 0; @@ -988,7 +988,7 @@ static int i_APCI3XXX_InsnReadTTLIO(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); int i_ReturnValue = insn->n; unsigned int *pls_ReadData = data; @@ -1103,7 +1103,7 @@ static int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; int i_ReturnValue = insn->n; unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); unsigned char b_State = 0; diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c index 247a8f1..1380919 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c +++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c @@ -1,11 +1,11 @@ #include +#include +#include #include "../comedidev.h" #include "comedi_fc.h" #include "amcc_s5933.h" -#include "addi-data/addi_common.h" - #ifndef COMEDI_SUBD_TTLIO #define COMEDI_SUBD_TTLIO 11 /* Digital Input Output But TTL */ #endif @@ -384,12 +384,27 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { }, }; +struct apci3xxx_private { + int iobase; + int i_IobaseReserved; + void __iomem *dw_AiBase; + unsigned char b_AiInitialisation; + unsigned int ui_AiNbrofChannels; /* how many channels is measured */ + unsigned int ui_AiReadData[32]; + unsigned char b_EocEosInterrupt; + unsigned int ui_EocEosConversionTime; + unsigned char b_EocEosConversionTimeBase; + unsigned char b_SingelDiff; + struct task_struct *tsk_Current; + unsigned int ul_TTLPortConfiguration[10]; +}; + #include "addi-data/hwdrv_apci3xxx.c" static irqreturn_t apci3xxx_irq_handler(int irq, void *d) { struct comedi_device *dev = d; - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; unsigned int status; int i; @@ -424,7 +439,7 @@ static int apci3xxx_di_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; data[1] = inl(devpriv->iobase + 32) & 0xf; @@ -436,7 +451,7 @@ static int apci3xxx_do_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; unsigned int mask = data[0]; unsigned int bits = data[1]; @@ -455,7 +470,7 @@ static int apci3xxx_do_insn_bits(struct comedi_device *dev, static int apci3xxx_reset(struct comedi_device *dev) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; unsigned int val; int i; @@ -490,7 +505,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev, { struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct apci3xxx_boardinfo *board = NULL; - struct addi_private *devpriv; + struct apci3xxx_private *devpriv; struct comedi_subdevice *s; int ret, n_subdevices; @@ -629,7 +644,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev, static void apci3xxx_detach(struct comedi_device *dev) { - struct addi_private *devpriv = dev->private; + struct apci3xxx_private *devpriv = dev->private; if (devpriv) { if (dev->iobase) -- 2.7.4