mirror of https://gitee.com/openkylin/linux.git
staging: comedi: addi_apci_2032: remove devpriv->iobase usage
The iobase address stored in devpriv->iobase is also stored in dev->iobase. Use that instead. 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>
This commit is contained in:
parent
dba18c58e0
commit
f5f760e1d3
|
@ -138,8 +138,8 @@ static int i_APCI2032_ConfigDigitalOutput(struct comedi_device *dev,
|
||||||
else {
|
else {
|
||||||
ul_Command = ul_Command & 0xFFFFFFFD;
|
ul_Command = ul_Command & 0xFFFFFFFD;
|
||||||
} /* elseif (data[2] == ADDIDATA_ENABLE) */
|
} /* elseif (data[2] == ADDIDATA_ENABLE) */
|
||||||
outl(ul_Command, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
|
outl(ul_Command, dev->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
|
||||||
ui_InterruptData = inl(devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
|
ui_InterruptData = inl(dev->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
|
||||||
return insn->n;
|
return insn->n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,16 +148,15 @@ static int apci2032_do_insn_bits(struct comedi_device *dev,
|
||||||
struct comedi_insn *insn,
|
struct comedi_insn *insn,
|
||||||
unsigned int *data)
|
unsigned int *data)
|
||||||
{
|
{
|
||||||
struct addi_private *devpriv = dev->private;
|
|
||||||
unsigned int mask = data[0];
|
unsigned int mask = data[0];
|
||||||
unsigned int bits = data[1];
|
unsigned int bits = data[1];
|
||||||
|
|
||||||
s->state = inl(devpriv->iobase + APCI2032_DIGITAL_OP_RW);
|
s->state = inl(dev->iobase + APCI2032_DIGITAL_OP_RW);
|
||||||
if (mask) {
|
if (mask) {
|
||||||
s->state &= ~mask;
|
s->state &= ~mask;
|
||||||
s->state |= (bits & mask);
|
s->state |= (bits & mask);
|
||||||
|
|
||||||
outl(s->state, devpriv->iobase + APCI2032_DIGITAL_OP);
|
outl(s->state, dev->iobase + APCI2032_DIGITAL_OP);
|
||||||
}
|
}
|
||||||
|
|
||||||
data[1] = s->state;
|
data[1] = s->state;
|
||||||
|
@ -190,16 +189,14 @@ static int i_APCI2032_ConfigWatchdog(struct comedi_device *dev,
|
||||||
struct comedi_insn *insn,
|
struct comedi_insn *insn,
|
||||||
unsigned int *data)
|
unsigned int *data)
|
||||||
{
|
{
|
||||||
struct addi_private *devpriv = dev->private;
|
|
||||||
|
|
||||||
if (data[0] == 0) {
|
if (data[0] == 0) {
|
||||||
/* Disable the watchdog */
|
/* Disable the watchdog */
|
||||||
outl(0x0,
|
outl(0x0,
|
||||||
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
||||||
APCI2032_TCW_PROG);
|
APCI2032_TCW_PROG);
|
||||||
/* Loading the Reload value */
|
/* Loading the Reload value */
|
||||||
outl(data[1],
|
outl(data[1],
|
||||||
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
||||||
APCI2032_TCW_RELOAD_VALUE);
|
APCI2032_TCW_RELOAD_VALUE);
|
||||||
} else {
|
} else {
|
||||||
printk("\nThe input parameters are wrong\n");
|
printk("\nThe input parameters are wrong\n");
|
||||||
|
@ -235,20 +232,18 @@ static int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev,
|
||||||
struct comedi_insn *insn,
|
struct comedi_insn *insn,
|
||||||
unsigned int *data)
|
unsigned int *data)
|
||||||
{
|
{
|
||||||
struct addi_private *devpriv = dev->private;
|
|
||||||
|
|
||||||
switch (data[0]) {
|
switch (data[0]) {
|
||||||
case 0: /* stop the watchdog */
|
case 0: /* stop the watchdog */
|
||||||
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
|
outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
|
||||||
break;
|
break;
|
||||||
case 1: /* start the watchdog */
|
case 1: /* start the watchdog */
|
||||||
outl(0x0001,
|
outl(0x0001,
|
||||||
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
||||||
APCI2032_TCW_PROG);
|
APCI2032_TCW_PROG);
|
||||||
break;
|
break;
|
||||||
case 2: /* Software trigger */
|
case 2: /* Software trigger */
|
||||||
outl(0x0201,
|
outl(0x0201,
|
||||||
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
||||||
APCI2032_TCW_PROG);
|
APCI2032_TCW_PROG);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -284,10 +279,8 @@ static int i_APCI2032_ReadWatchdog(struct comedi_device *dev,
|
||||||
struct comedi_insn *insn,
|
struct comedi_insn *insn,
|
||||||
unsigned int *data)
|
unsigned int *data)
|
||||||
{
|
{
|
||||||
struct addi_private *devpriv = dev->private;
|
|
||||||
|
|
||||||
data[0] =
|
data[0] =
|
||||||
inl(devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
inl(dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
|
||||||
APCI2032_TCW_TRIG_STATUS) & 0x1;
|
APCI2032_TCW_TRIG_STATUS) & 0x1;
|
||||||
return insn->n;
|
return insn->n;
|
||||||
}
|
}
|
||||||
|
@ -315,7 +308,7 @@ static void v_APCI2032_Interrupt(int irq, void *d)
|
||||||
struct addi_private *devpriv = dev->private;
|
struct addi_private *devpriv = dev->private;
|
||||||
unsigned int ui_DO;
|
unsigned int ui_DO;
|
||||||
|
|
||||||
ui_DO = inl(devpriv->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; /* Check if VCC OR CC interrupt has occurred. */
|
ui_DO = inl(dev->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; /* Check if VCC OR CC interrupt has occurred. */
|
||||||
|
|
||||||
if (ui_DO == 0) {
|
if (ui_DO == 0) {
|
||||||
printk("\nInterrupt from unKnown source\n");
|
printk("\nInterrupt from unKnown source\n");
|
||||||
|
@ -323,10 +316,10 @@ static void v_APCI2032_Interrupt(int irq, void *d)
|
||||||
if (ui_DO) {
|
if (ui_DO) {
|
||||||
/* Check for Digital Output interrupt Type - 1: Vcc interrupt 2: CC interrupt. */
|
/* Check for Digital Output interrupt Type - 1: Vcc interrupt 2: CC interrupt. */
|
||||||
ui_Type =
|
ui_Type =
|
||||||
inl(devpriv->iobase +
|
inl(dev->iobase +
|
||||||
APCI2032_DIGITAL_OP_INTERRUPT_STATUS) & 0x3;
|
APCI2032_DIGITAL_OP_INTERRUPT_STATUS) & 0x3;
|
||||||
outl(0x0,
|
outl(0x0,
|
||||||
devpriv->iobase + APCI2032_DIGITAL_OP +
|
dev->iobase + APCI2032_DIGITAL_OP +
|
||||||
APCI2032_DIGITAL_OP_INTERRUPT);
|
APCI2032_DIGITAL_OP_INTERRUPT);
|
||||||
if (ui_Type == 1) {
|
if (ui_Type == 1) {
|
||||||
/* Sends signal to user space */
|
/* Sends signal to user space */
|
||||||
|
|
|
@ -38,10 +38,10 @@ static int apci2032_reset(struct comedi_device *dev)
|
||||||
|
|
||||||
devpriv->b_DigitalOutputRegister = 0;
|
devpriv->b_DigitalOutputRegister = 0;
|
||||||
ui_Type = 0;
|
ui_Type = 0;
|
||||||
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP);
|
outl(0x0, dev->iobase + APCI2032_DIGITAL_OP);
|
||||||
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
|
outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
|
||||||
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG);
|
outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG);
|
||||||
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE);
|
outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,6 @@ static int apci2032_auto_attach(struct comedi_device *dev,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
dev->iobase = pci_resource_start(pcidev, 1);
|
dev->iobase = pci_resource_start(pcidev, 1);
|
||||||
devpriv->iobase = dev->iobase;
|
|
||||||
devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
|
devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
|
||||||
devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
|
devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
|
||||||
devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
|
devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
|
||||||
|
|
Loading…
Reference in New Issue