From e053b2419f5f0cff8ced6a8e39a93d113d9cd86a Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 12 Jun 2013 16:10:16 -0700 Subject: [PATCH] staging: comedi: addi_apci_3xxx: introduce a private boardinfo definition The struct addi_board definition from the addi-data "common" code is very bloated. Introduce a private struct apci3xxx_boardinfo that just has the data needed by this driver. Move the #include "addi-data/hwdrv_apci3xxx.c" so it will have the new struct definition. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci3xxx.c | 6 ++--- .../staging/comedi/drivers/addi_apci_3xxx.c | 24 +++++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c index 08dce6095294..ef83ed496927 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c @@ -114,7 +114,7 @@ static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - const struct addi_board *this_board = comedi_board(dev); + const struct apci3xxx_boardinfo *this_board = comedi_board(dev); struct addi_private *devpriv = dev->private; int i_ReturnValue = insn->n; unsigned char b_TimeBase = 0; @@ -365,7 +365,7 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - const struct addi_board *this_board = comedi_board(dev); + const struct apci3xxx_boardinfo *this_board = comedi_board(dev); struct addi_private *devpriv = dev->private; int i_ReturnValue = insn->n; unsigned char b_Configuration = (unsigned char) CR_RANGE(insn->chanspec); @@ -595,7 +595,7 @@ static int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - const struct addi_board *board = comedi_board(dev); + const struct apci3xxx_boardinfo *board = comedi_board(dev); struct addi_private *devpriv = dev->private; unsigned char b_Range = (unsigned char) CR_RANGE(insn->chanspec); unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c index 09cbb04e25d4..247a8f12c47d 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c +++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c @@ -6,8 +6,6 @@ #include "addi-data/addi_common.h" -#include "addi-data/hwdrv_apci3xxx.c" - #ifndef COMEDI_SUBD_TTLIO #define COMEDI_SUBD_TTLIO 11 /* Digital Input Output But TTL */ #endif @@ -60,7 +58,23 @@ enum apci3xxx_boardid { BOARD_APCI3500, }; -static const struct addi_board apci3xxx_boardtypes[] = { +struct apci3xxx_boardinfo { + const char *pc_DriverName; + int i_IorangeBase1; + int i_NbrAiChannel; + int i_NbrAiChannelDiff; + int i_AiChannelList; + int i_NbrAoChannel; + int i_AiMaxdata; + int i_AoMaxdata; + int i_NbrDiChannel; + int i_NbrDoChannel; + int i_NbrTTLChannel; + unsigned char b_AvailableConvertUnit; + unsigned int ui_MinAcquisitiontimeNs; +}; + +static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { [BOARD_APCI3000_16] = { .pc_DriverName = "apci3000-16", .i_IorangeBase1 = 256, @@ -370,6 +384,8 @@ static const struct addi_board apci3xxx_boardtypes[] = { }, }; +#include "addi-data/hwdrv_apci3xxx.c" + static irqreturn_t apci3xxx_irq_handler(int irq, void *d) { struct comedi_device *dev = d; @@ -473,7 +489,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct addi_board *board = NULL; + const struct apci3xxx_boardinfo *board = NULL; struct addi_private *devpriv; struct comedi_subdevice *s; int ret, n_subdevices; -- 2.39.5