* [PATCH 13/36] staging: comedi: cb_pcidas: remove the PCI BAR index defines
@ 2012-06-27 0:54 H Hartley Sweeten
0 siblings, 0 replies; only message in thread
From: H Hartley Sweeten @ 2012-06-27 0:54 UTC (permalink / raw)
To: Linux Kernel; +Cc: devel, abbotti, fmhess, gregkh
The defines for the "indices of the base address regions" don't
add much to the readability of the code. They are only used in
the pci_resource_start() calls to get the base address for
the various io regions and the names of the variables provide
adequate documentation.
Remove the defines and just use the open-coded values for the
BARs. Also, remove the incomplete comment above the initialization
of the variables.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/staging/comedi/drivers/cb_pcidas.c | 32 ++++++++----------------------
1 file changed, 8 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 990e6ab..4e5f1ba 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -92,14 +92,6 @@ analog triggering on 1602 series
#define NUM_CHANNELS_8402 2
#define NUM_CHANNELS_DAC08 1
-/* PCI-DAS base addresses */
-
-/* indices of base address regions */
-#define S5933_BADRINDEX 0
-#define CONT_STAT_BADRINDEX 1
-#define ADC_FIFO_BADRINDEX 2
-#define PACER_BADRINDEX 3
-#define AO_BADRINDEX 4
/* sizes of io regions */
#define CONT_STAT_SIZE 10
#define ADC_FIFO_SIZE 4
@@ -1670,22 +1662,14 @@ static int cb_pcidas_attach(struct comedi_device *dev,
"Failed to enable PCI device and request regions\n");
return -EIO;
}
- /*
- * Initialize devpriv->control_status and devpriv->adc_fifo to point to
- * their base address.
- */
- devpriv->s5933_config =
- pci_resource_start(devpriv->pci_dev, S5933_BADRINDEX);
- devpriv->control_status =
- pci_resource_start(devpriv->pci_dev, CONT_STAT_BADRINDEX);
- devpriv->adc_fifo =
- pci_resource_start(devpriv->pci_dev, ADC_FIFO_BADRINDEX);
- devpriv->pacer_counter_dio =
- pci_resource_start(devpriv->pci_dev, PACER_BADRINDEX);
- if (thisboard->ao_nchan) {
- devpriv->ao_registers =
- pci_resource_start(devpriv->pci_dev, AO_BADRINDEX);
- }
+
+ devpriv->s5933_config = pci_resource_start(devpriv->pci_dev, 0);
+ devpriv->control_status = pci_resource_start(devpriv->pci_dev, 1);
+ devpriv->adc_fifo = pci_resource_start(devpriv->pci_dev, 2);
+ devpriv->pacer_counter_dio = pci_resource_start(devpriv->pci_dev, 3);
+ if (thisboard->ao_nchan)
+ devpriv->ao_registers = pci_resource_start(devpriv->pci_dev, 4);
+
/* disable and clear interrupts on amcc s5933 */
outl(INTCSR_INBOX_INTR_STATUS,
devpriv->s5933_config + AMCC_OP_REG_INTCSR);
--
1.7.11
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-27 0:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 0:54 [PATCH 13/36] staging: comedi: cb_pcidas: remove the PCI BAR index defines H Hartley Sweeten
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®