From 7e5c304c5bec82b9187e73ae8fa398ee9b25dbfd Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 18 Jun 2013 12:13:49 -0700 Subject: [PATCH] staging: comedi: addi-data: remove unused vars from private data Due to the on-going cleanup of the addi-data drivers, the private data used in the "common" code has a number of variables that either are not used at all or or set but never used. Remove all of them from the private data and the unnecessary use in the drivers. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/addi_common.c | 6 ------ .../comedi/drivers/addi-data/addi_common.h | 18 ------------------ .../comedi/drivers/addi-data/hwdrv_apci3120.c | 6 ------ .../staging/comedi/drivers/addi_apci_3120.c | 5 ----- 4 files changed, 35 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/addi_common.c b/drivers/staging/comedi/drivers/addi-data/addi_common.c index f0cc32bae766..a3a43901c2e2 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_common.c +++ b/drivers/staging/comedi/drivers/addi-data/addi_common.c @@ -113,7 +113,6 @@ static int addi_auto_attach(struct comedi_device *dev, /* board has an ADDIDATA_9054 eeprom */ dev->iobase = pci_resource_start(pcidev, 2); devpriv->iobase = pci_resource_start(pcidev, 2); - devpriv->dw_AiBase = pci_ioremap_bar(pcidev, 3); } devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3); @@ -184,9 +183,6 @@ static int addi_auto_attach(struct comedi_device *dev, s->len_chanlist = this_board->i_AiChannelList; s->range_table = this_board->pr_AiRangelist; - /* Set the initialisation flag */ - devpriv->b_AiInitialisation = 1; - s->insn_config = this_board->ai_config; s->insn_read = this_board->ai_read; s->insn_write = this_board->ai_write; @@ -316,8 +312,6 @@ static void i_ADDI_Detach(struct comedi_device *dev) i_ADDI_Reset(dev); if (dev->irq) free_irq(dev->irq, dev); - if (devpriv->dw_AiBase) - iounmap(devpriv->dw_AiBase); } comedi_pci_disable(dev); } diff --git a/drivers/staging/comedi/drivers/addi-data/addi_common.h b/drivers/staging/comedi/drivers/addi-data/addi_common.h index c034bf1426eb..98ceef8c229b 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_common.h +++ b/drivers/staging/comedi/drivers/addi-data/addi_common.h @@ -283,58 +283,41 @@ union str_ModuleInfo { /* Private structure for the addi_apci3120 driver */ struct addi_private { - int iobase; int i_IobaseAmcc; /* base+size for AMCC chip */ int i_IobaseAddon; /* addon base address */ int i_IobaseReserved; - void __iomem *dw_AiBase; unsigned char b_AiContinuous; /* we do unlimited AI */ - unsigned char b_AiInitialisation; unsigned int ui_AiActualScan; /* how many scans we finished */ - unsigned int ui_AiBufferPtr; /* data buffer ptr in samples */ unsigned int ui_AiNbrofChannels; /* how many channels is measured */ unsigned int ui_AiScanLength; /* Length of actual scanlist */ - unsigned int ui_AiActualScanPosition; /* position in actual scan */ unsigned int *pui_AiChannelList; /* actual chanlist */ unsigned int ui_AiChannelList[32]; /* actual chanlist */ - unsigned char b_AiChannelConfiguration[32]; /* actual chanlist */ unsigned int ui_AiReadData[32]; - unsigned int dw_AiInitialised; unsigned int ui_AiTimer0; /* Timer Constant for Timer0 */ unsigned int ui_AiTimer1; /* Timer constant for Timer1 */ unsigned int ui_AiFlags; unsigned int ui_AiDataLength; - short *AiData; /* Pointer to sample data */ unsigned int ui_AiNbrofScans; /* number of scans to do */ unsigned short us_UseDma; /* To use Dma or not */ unsigned char b_DmaDoubleBuffer; /* we can use double buffering */ unsigned int ui_DmaActualBuffer; /* which buffer is used now */ - /* UPDATE-0.7.57->0.7.68 */ - /* unsigned int ul_DmaBufferVirtual[2]; pointers to begin of DMA buffer */ short *ul_DmaBufferVirtual[2]; /* pointers to begin of DMA buffer */ unsigned int ul_DmaBufferHw[2]; /* hw address of DMA buff */ unsigned int ui_DmaBufferSize[2]; /* size of dma buffer in bytes */ unsigned int ui_DmaBufferUsesize[2]; /* which size we may now used for transfer */ - unsigned int ui_DmaBufferSamples[2]; /* size in samples */ unsigned int ui_DmaBufferPages[2]; /* number of pages in buffer */ unsigned char b_DigitalOutputRegister; /* Digital Output Register */ unsigned char b_OutputMemoryStatus; - unsigned char b_AnalogInputChannelNbr; /* Analog input channel Nbr */ - unsigned char b_AnalogOutputChannelNbr; /* Analog input Output Nbr */ unsigned char b_TimerSelectMode; /* Contain data written at iobase + 0C */ unsigned char b_ModeSelectRegister; /* Contain data written at iobase + 0E */ unsigned short us_OutputRegister; /* Contain data written at iobase + 0 */ - unsigned char b_InterruptState; - unsigned char b_TimerInit; /* Specify if InitTimerWatchdog was load */ - unsigned char b_TimerStarted; /* Specify if timer 2 is running or not */ unsigned char b_Timer2Mode; /* Specify the timer 2 mode */ unsigned char b_Timer2Interrupt; /* Timer2 interrupt enable or disable */ unsigned char b_AiCyclicAcquisition; /* indicate cyclic acquisition */ unsigned char b_InterruptMode; /* eoc eos or dma */ unsigned char b_EocEosInterrupt; /* Enable disable eoc eos interrupt */ unsigned int ui_EocEosConversionTime; - unsigned char b_EocEosConversionTimeBase; unsigned char b_SingelDiff; unsigned char b_ExttrigEnable; /* To enable or disable external trigger */ @@ -365,7 +348,6 @@ struct addi_private { } s_InterruptParameters; union str_ModuleInfo s_ModuleInfo[4]; - unsigned int ul_TTLPortConfiguration[10]; /* Parameters read from EEPROM overriding static board info */ struct { diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index 81eb51e0195a..a89e505c8a3a 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c @@ -720,9 +720,7 @@ static int i_APCI3120_StopCyclicAcquisition(struct comedi_device *dev, inb(dev->iobase + APCI3120_RESET_FIFO); inw(dev->iobase + APCI3120_RD_STATUS); devpriv->ui_AiActualScan = 0; - devpriv->ui_AiActualScanPosition = 0; s->async->cur_chan = 0; - devpriv->ui_AiBufferPtr = 0; devpriv->b_AiContinuous = 0; devpriv->ui_DmaActualBuffer = 0; @@ -891,9 +889,7 @@ static int i_APCI3120_CyclicAnalogInput(int mode, /* END JK 07.05.04: Comparison between WIN32 and Linux driver */ devpriv->ui_AiActualScan = 0; - devpriv->ui_AiActualScanPosition = 0; s->async->cur_chan = 0; - devpriv->ui_AiBufferPtr = 0; devpriv->ui_DmaActualBuffer = 0; /* value for timer2 minus -2 has to be done .....dunno y?? */ @@ -1347,8 +1343,6 @@ static int i_APCI3120_CommandAnalogInput(struct comedi_device *dev, devpriv->ui_AiScanLength = cmd->scan_end_arg; devpriv->pui_AiChannelList = cmd->chanlist; - /* UPDATE-0.7.57->0.7.68devpriv->AiData=s->async->data; */ - devpriv->AiData = s->async->prealloc_buf; /* UPDATE-0.7.57->0.7.68devpriv->ui_AiDataLength=s->async->data_len; */ devpriv->ui_AiDataLength = s->async->prealloc_bufsz; diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index 317a26d97c2e..61452848510f 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -103,8 +103,6 @@ static int apci3120_auto_attach(struct comedi_device *dev, if (devpriv->ul_DmaBufferVirtual[i]) { devpriv->ui_DmaBufferPages[i] = pages; devpriv->ui_DmaBufferSize[i] = PAGE_SIZE * pages; - devpriv->ui_DmaBufferSamples[i] = - devpriv->ui_DmaBufferSize[i] >> 1; devpriv->ul_DmaBufferHw[i] = virt_to_bus((void *)devpriv-> ul_DmaBufferVirtual[i]); @@ -138,9 +136,6 @@ static int apci3120_auto_attach(struct comedi_device *dev, s->len_chanlist = this_board->i_AiChannelList; s->range_table = &range_apci3120_ai; - /* Set the initialisation flag */ - devpriv->b_AiInitialisation = 1; - s->insn_config = i_APCI3120_InsnConfigAnalogInput; s->insn_read = i_APCI3120_InsnReadAnalogInput; s->do_cmdtest = i_APCI3120_CommandTestAnalogInput; -- 2.39.5