From 1d967a0356765cbef8351418613da83bb3d0d85a Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 17 Jan 2013 17:38:44 -0700 Subject: [PATCH] staging: comedi: addi_apci_2200: 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci2200.c | 48 +++++++------------ .../staging/comedi/drivers/addi_apci_2200.c | 11 ++--- 2 files changed, 21 insertions(+), 38 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c index e4a422e7cbdf..3217203c604d 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c @@ -65,9 +65,7 @@ static int apci2200_di_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; - - data[1] = inw(devpriv->iobase + APCI2200_DIGITAL_IP); + data[1] = inw(dev->iobase + APCI2200_DIGITAL_IP); return insn->n; } @@ -77,16 +75,15 @@ static int apci2200_do_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; unsigned int mask = data[0]; unsigned int bits = data[1]; - s->state = inw(devpriv->iobase + APCI2200_DIGITAL_OP); + s->state = inw(dev->iobase + APCI2200_DIGITAL_OP); if (mask) { s->state &= ~mask; s->state |= (bits & mask); - outw(s->state, devpriv->iobase + APCI2200_DIGITAL_OP); + outw(s->state, dev->iobase + APCI2200_DIGITAL_OP); } data[1] = s->state; @@ -120,21 +117,16 @@ static int i_APCI2200_ConfigWatchdog(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; - if (data[0] == 0) { /* Disable the watchdog */ - outw(0x0, - devpriv->iobase + APCI2200_WATCHDOG + - APCI2200_WATCHDOG_ENABLEDISABLE); + outw(0x0, dev->iobase + APCI2200_WATCHDOG + + APCI2200_WATCHDOG_ENABLEDISABLE); /* Loading the Reload value */ - outw(data[1], - devpriv->iobase + APCI2200_WATCHDOG + - APCI2200_WATCHDOG_RELOAD_VALUE); + outw(data[1], dev->iobase + APCI2200_WATCHDOG + + APCI2200_WATCHDOG_RELOAD_VALUE); data[1] = data[1] >> 16; - outw(data[1], - devpriv->iobase + APCI2200_WATCHDOG + - APCI2200_WATCHDOG_RELOAD_VALUE + 2); + outw(data[1], dev->iobase + APCI2200_WATCHDOG + + APCI2200_WATCHDOG_RELOAD_VALUE + 2); } /* if(data[0]==0) */ else { printk("\nThe input parameters are wrong\n"); @@ -170,21 +162,18 @@ static int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; - switch (data[0]) { case 0: /* stop the watchdog */ - outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */ + outw(0x0, dev->iobase + APCI2200_WATCHDOG + + APCI2200_WATCHDOG_ENABLEDISABLE); break; case 1: /* start the watchdog */ - outw(0x0001, - devpriv->iobase + APCI2200_WATCHDOG + - APCI2200_WATCHDOG_ENABLEDISABLE); + outw(0x0001, dev->iobase + APCI2200_WATCHDOG + + APCI2200_WATCHDOG_ENABLEDISABLE); break; case 2: /* Software trigger */ - outw(0x0201, - devpriv->iobase + APCI2200_WATCHDOG + - APCI2200_WATCHDOG_ENABLEDISABLE); + outw(0x0201, dev->iobase + APCI2200_WATCHDOG + + APCI2200_WATCHDOG_ENABLEDISABLE); break; default: printk("\nSpecified functionality does not exist\n"); @@ -219,10 +208,7 @@ static int i_APCI2200_ReadWatchdog(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct addi_private *devpriv = dev->private; - - data[0] = - inw(devpriv->iobase + APCI2200_WATCHDOG + - APCI2200_WATCHDOG_STATUS) & 0x1; + data[0] = inw(dev->iobase + APCI2200_WATCHDOG + + APCI2200_WATCHDOG_STATUS) & 0x1; return insn->n; } diff --git a/drivers/staging/comedi/drivers/addi_apci_2200.c b/drivers/staging/comedi/drivers/addi_apci_2200.c index 1205fe9a620b..cd1ac415a705 100644 --- a/drivers/staging/comedi/drivers/addi_apci_2200.c +++ b/drivers/staging/comedi/drivers/addi_apci_2200.c @@ -32,14 +32,12 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d) static int apci2200_reset(struct comedi_device *dev) { - struct addi_private *devpriv = dev->private; - - outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP); - outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + + outw(0x0, dev->iobase + APCI2200_DIGITAL_OP); + outw(0x0, dev->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE); - outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + + outw(0x0, dev->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_RELOAD_VALUE); - outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + + outw(0x0, dev->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_RELOAD_VALUE + 2); return 0; @@ -87,7 +85,6 @@ static int apci2200_auto_attach(struct comedi_device *dev, return ret; dev->iobase = pci_resource_start(pcidev, 1); - 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); -- 2.20.1