summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-09-08 00:48:09 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-08 04:54:42 (GMT)
commitfe531d12acff926628df11df6d476474383a9f3f (patch)
treeea7a978c05551d7fe1b394650ca77658ae7b2032
parent5f8f8d43506652a361f81abc5ccd18c608dfc84d (diff)
downloadlinux-fsl-qoriq-fe531d12acff926628df11df6d476474383a9f3f.tar.xz
staging: comedi: me4000: remove program_regbase from private data
The program_regbase variable in the private data is only used when the board is first attached. This variable holds the pci base address used to read/write the xilinx part to upload the firmware. Use a local variable in the xilinx_download() function to hold this address and remove program_regbase from the private data. 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/me4000.c13
-rw-r--r--drivers/staging/comedi/drivers/me4000.h1
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c
index 12b3cf8..f2c8d04 100644
--- a/drivers/staging/comedi/drivers/me4000.c
+++ b/drivers/staging/comedi/drivers/me4000.c
@@ -223,12 +223,17 @@ extern unsigned char *xilinx_firm;
static int xilinx_download(struct comedi_device *dev)
{
+ struct pci_dev *pcidev = comedi_to_pci_dev(dev);
struct me4000_info *info = dev->private;
+ unsigned long xilinx_iobase = pci_resource_start(pcidev, 5);
u32 value = 0;
wait_queue_head_t queue;
int idx = 0;
int size = 0;
+ if (!xilinx_iobase)
+ return -ENODEV;
+
init_waitqueue_head(&queue);
/*
@@ -243,7 +248,7 @@ static int xilinx_download(struct comedi_device *dev)
outl(value, info->plx_regbase + PLX_ICR);
/* Init Xilinx with CS1 */
- inb(info->program_regbase + 0xC8);
+ inb(xilinx_iobase + 0xC8);
/* Wait until /INIT pin is set */
udelay(20);
@@ -269,7 +274,7 @@ static int xilinx_download(struct comedi_device *dev)
udelay(10);
for (idx = 0; idx < size; idx++) {
- outb(xilinx_firm[16 + idx], info->program_regbase);
+ outb(xilinx_firm[16 + idx], xilinx_iobase);
udelay(10);
/* Check if BUSY flag is low */
@@ -1782,10 +1787,6 @@ static int me4000_attach_pci(struct comedi_device *dev,
if (!info->timer_regbase)
return -ENODEV;
- info->program_regbase = pci_resource_start(pcidev, 5);
- if (!info->program_regbase)
- return -ENODEV;
-
dev->irq = pcidev->irq;
result = xilinx_download(dev);
diff --git a/drivers/staging/comedi/drivers/me4000.h b/drivers/staging/comedi/drivers/me4000.h
index b6d8e3b..7feb574 100644
--- a/drivers/staging/comedi/drivers/me4000.h
+++ b/drivers/staging/comedi/drivers/me4000.h
@@ -220,7 +220,6 @@
struct me4000_info {
unsigned long plx_regbase; /* PLX configuration space base address */
unsigned long timer_regbase; /* Base address of the timer circuit */
- unsigned long program_regbase; /* Base address to set the program pin for the xilinx */
unsigned int ao_readback[4];
};