For aesthetics, convert the enum for the PCI Bar 1 register map to defines and move them to the main driver source file. Rename the registers. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- .../comedi/drivers/addi-data/hwdrv_apci1500.c | 35 ++++++++-------------- drivers/staging/comedi/drivers/addi_apci_1500.c | 8 +++++ 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c index 50fecd4..c593931 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c @@ -51,16 +51,6 @@ #define TRIGGER 2 /* - * Zillog I/O enumeration - */ -enum { - APCI1500_Z8536_PORT_C, - APCI1500_Z8536_PORT_B, - APCI1500_Z8536_PORT_A, - APCI1500_Z8536_CONTROL_REGISTER -}; - -/* * Z8536 CIO Internal Address */ enum { @@ -133,8 +123,8 @@ static unsigned int z8536_read(struct comedi_device *dev, unsigned int reg) { struct apci1500_private *devpriv = dev->private; - outb(reg, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - return inb(devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); + outb(reg, devpriv->iobase + APCI1500_Z8536_CTRL_REG); + return inb(devpriv->iobase + APCI1500_Z8536_CTRL_REG); } static void z8536_write(struct comedi_device *dev, @@ -142,8 +132,8 @@ static void z8536_write(struct comedi_device *dev, { struct apci1500_private *devpriv = dev->private; - outb(reg, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - outb(val, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); + outb(reg, devpriv->iobase + APCI1500_Z8536_CTRL_REG); + outb(val, devpriv->iobase + APCI1500_Z8536_CTRL_REG); } static void z8536_reset(struct comedi_device *dev) @@ -154,12 +144,12 @@ static void z8536_reset(struct comedi_device *dev) * Even if the state of the Z8536 is not known, the following * sequence will reset it and put it in State 0. */ - inb(devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - outb(0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - inb(devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - outb(0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - outb(1, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - outb(0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); + inb(devpriv->iobase + APCI1500_Z8536_CTRL_REG); + outb(0, devpriv->iobase + APCI1500_Z8536_CTRL_REG); + inb(devpriv->iobase + APCI1500_Z8536_CTRL_REG); + outb(0, devpriv->iobase + APCI1500_Z8536_CTRL_REG); + outb(1, devpriv->iobase + APCI1500_Z8536_CTRL_REG); + outb(0, devpriv->iobase + APCI1500_Z8536_CTRL_REG); z8536_write(dev, 0xf4, APCI1500_RW_MASTER_CONFIGURATION_CONTROL); @@ -1539,9 +1529,8 @@ static irqreturn_t apci1500_interrupt(int irq, void *d) z8536_write(dev, i_RegValue, APCI1500_RW_PORT_B_COMMAND_AND_STATUS); /* Reads port B */ - i_RegValue = - inb((unsigned int) devpriv->iobase + - APCI1500_Z8536_PORT_B); + i_RegValue = inb(devpriv->iobase + + APCI1500_Z8536_PORTB_REG); i_RegValue = i_RegValue & 0xC0; /* Tests if this is an external error */ diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c index 30b132c..dc7ecde 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1500.c +++ b/drivers/staging/comedi/drivers/addi_apci_1500.c @@ -7,6 +7,14 @@ #include "comedi_fc.h" #include "amcc_s5933.h" +/* +* PCI Bar 1 Register map (devpriv->iobase) + */ +#define APCI1500_Z8536_PORTC_REG 0x00 +#define APCI1500_Z8536_PORTB_REG 0x01 +#define APCI1500_Z8536_PORTA_REG 0x02 +#define APCI1500_Z8536_CTRL_REG 0x03 + struct apci1500_private { int iobase; int i_IobaseAmcc; -- 2.0.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel