From: H Hartley Sweeten Date: Tue, 4 Nov 2014 17:55:25 +0000 (-0700) Subject: staging: comedi: addi_apci_3120: move apci3120_cancel() to driver X-Git-Tag: v3.19-rc1~66^2~254 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=676caedabd62f23ce345c044de30ca3051d8d41b;p=karo-tx-linux.git staging: comedi: addi_apci_3120: move apci3120_cancel() to driver Move this function from the included source file to the main driver source file. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index 505901c6ec2a..66e71d5193a2 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c @@ -1,31 +1,3 @@ -static int apci3120_cancel(struct comedi_device *dev, - struct comedi_subdevice *s) -{ - struct apci3120_private *devpriv = dev->private; - - /* Add-On - disable DMA */ - outw(0, devpriv->addon + 4); - - /* Add-On - disable bus master */ - apci3120_addon_write(dev, 0, AMCC_OP_REG_AGCSTS); - - /* AMCC - disable bus master */ - outl(0, devpriv->amcc + AMCC_OP_REG_MCSR); - - /* disable all counters, ext trigger, and reset scan */ - devpriv->ctrl = 0; - outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG); - - /* DISABLE_ALL_INTERRUPT */ - devpriv->mode = 0; - outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG); - - inw(dev->iobase + APCI3120_STATUS_REG); - devpriv->cur_dmabuf = 0; - - return 0; -} - /* * This is a handler for the DMA interrupt. * This function copies the data to Comedi Buffer. diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index 8fd498d0031a..fd5306efc021 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -560,6 +560,34 @@ static int apci3120_ai_cmdtest(struct comedi_device *dev, return 0; } +static int apci3120_cancel(struct comedi_device *dev, + struct comedi_subdevice *s) +{ + struct apci3120_private *devpriv = dev->private; + + /* Add-On - disable DMA */ + outw(0, devpriv->addon + 4); + + /* Add-On - disable bus master */ + apci3120_addon_write(dev, 0, AMCC_OP_REG_AGCSTS); + + /* AMCC - disable bus master */ + outl(0, devpriv->amcc + AMCC_OP_REG_MCSR); + + /* disable all counters, ext trigger, and reset scan */ + devpriv->ctrl = 0; + outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG); + + /* DISABLE_ALL_INTERRUPT */ + devpriv->mode = 0; + outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG); + + inw(dev->iobase + APCI3120_STATUS_REG); + devpriv->cur_dmabuf = 0; + + return 0; +} + static int apci3120_ai_eoc(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn,