From 887f706edf86fe90d04f0df83704d612722e3d36 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 1 Nov 2012 17:25:11 -0700 Subject: [PATCH] staging: comedi: addi_apci_3120: remove eeprom handling code The boards supported by this driver do not have an eeprom. Remove the unnecessary code to handle it. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_3120.c | 70 +++---------------------- 1 file changed, 8 insertions(+), 62 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index 05ff3e2..3acc595 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -4,7 +4,6 @@ #include "addi-data/addi_common.h" -#include "addi-data/addi_eeprom.c" #include "addi-data/hwdrv_apci3120.c" #ifndef COMEDI_SUBD_TTLIO @@ -19,7 +18,6 @@ static const struct addi_board apci3120_boardtypes[] = { .i_IorangeBase0 = AMCC_OP_REG_SIZE, .i_IorangeBase1 = APCI3120_ADDRESS_RANGE, .i_IorangeBase2 = 8, - .i_PCIEeprom = ADDIDATA_NO_EEPROM, .i_NbrAiChannel = 16, .i_NbrAiChannelDiff = 8, .i_AiChannelList = 16, @@ -59,7 +57,6 @@ static const struct addi_board apci3120_boardtypes[] = { .i_IorangeBase0 = AMCC_OP_REG_SIZE, .i_IorangeBase1 = APCI3120_ADDRESS_RANGE, .i_IorangeBase2 = 8, - .i_PCIEeprom = ADDIDATA_NO_EEPROM, .i_NbrAiChannel = 16, .i_NbrAiChannelDiff = 8, .i_AiChannelList = 16, @@ -91,23 +88,6 @@ static const struct addi_board apci3120_boardtypes[] = { }, }; -static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev, - struct comedi_subdevice *s, - struct comedi_insn *insn, - unsigned int *data) -{ - const struct addi_board *this_board = comedi_board(dev); - struct addi_private *devpriv = dev->private; - unsigned short w_Address = CR_CHAN(insn->chanspec); - unsigned short w_Data; - - w_Data = addi_eeprom_readw(devpriv->i_IobaseAmcc, - this_board->pc_EepromChip, 2 * w_Address); - data[0] = w_Data; - - return insn->n; -} - static irqreturn_t v_ADDI_Interrupt(int irq, void *d) { struct comedi_device *dev = d; @@ -149,7 +129,6 @@ static int apci3120_attach_pci(struct comedi_device *dev, struct addi_private *devpriv; struct comedi_subdevice *s; int ret, pages, i, n_subdevices; - unsigned int dw_Dummy; this_board = addi_find_boardinfo(dev, pcidev); if (!this_board) @@ -168,22 +147,14 @@ static int apci3120_attach_pci(struct comedi_device *dev, if (this_board->i_Dma) pci_set_master(pcidev); - if (!this_board->pc_EepromChip || - !strcmp(this_board->pc_EepromChip, ADDIDATA_9054)) { - if (this_board->i_IorangeBase1) - dev->iobase = pci_resource_start(pcidev, 1); - else - dev->iobase = pci_resource_start(pcidev, 0); + if (this_board->i_IorangeBase1) + dev->iobase = pci_resource_start(pcidev, 1); + else + dev->iobase = pci_resource_start(pcidev, 0); - devpriv->iobase = dev->iobase; - devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0); - devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2); - } else { - dev->iobase = pci_resource_start(pcidev, 2); - devpriv->iobase = pci_resource_start(pcidev, 2); - devpriv->dw_AiBase = ioremap(pci_resource_start(pcidev, 3), - this_board->i_IorangeBase3); - } + devpriv->iobase = dev->iobase; + devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0); + devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2); devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3); /* Initialize parameters that can be overridden in EEPROM */ @@ -210,23 +181,6 @@ static int apci3120_attach_pci(struct comedi_device *dev, dev->irq = pcidev->irq; } - /* Read eepeom and fill addi_board Structure */ - - if (this_board->i_PCIEeprom) { - if (!(strcmp(this_board->pc_EepromChip, "S5920"))) { - /* Set 3 wait stait */ - if (!(strcmp(dev->board_name, "apci035"))) { - outl(0x80808082, devpriv->i_IobaseAmcc + 0x60); - } else { - outl(0x83838383, devpriv->i_IobaseAmcc + 0x60); - } - /* Enable the interrupt for the controller */ - dw_Dummy = inl(devpriv->i_IobaseAmcc + 0x38); - outl(dw_Dummy | 0x2000, devpriv->i_IobaseAmcc + 0x38); - } - addi_eeprom_read_info(dev, pci_resource_start(pcidev, 0)); - } - devpriv->us_UseDma = ADDI_ENABLE; if (devpriv->s_EeParameters.i_Dma) { @@ -396,15 +350,7 @@ static int apci3120_attach_pci(struct comedi_device *dev, /* EEPROM */ s = &dev->subdevices[6]; - if (this_board->i_PCIEeprom) { - s->type = COMEDI_SUBD_MEMORY; - s->subdev_flags = SDF_READABLE | SDF_INTERNAL; - s->n_chan = 256; - s->maxdata = 0xffff; - s->insn_read = i_ADDIDATA_InsnReadEeprom; - } else { - s->type = COMEDI_SUBD_UNUSED; - } + s->type = COMEDI_SUBD_UNUSED; i_ADDI_Reset(dev); return 0; -- 2.7.4