summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-11-13 20:46:52 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-13 23:12:55 (GMT)
commit9151b01f3c5155d67d4dbd1c294694d57859dbec (patch)
tree76960edc6a1c68f85d300c43814b3a87649dfa34 /drivers/staging/comedi
parent5c7c83230c1b0f490fa98402ea666609527d6558 (diff)
downloadlinux-fsl-qoriq-9151b01f3c5155d67d4dbd1c294694d57859dbec.tar.xz
staging: comedi: addi_apci_1516: fix i_APCI1516_ReadWatchdog()
This function is used by the watchdog subdevice to read the status of the watchdog. Rename the CamelCase function to apci1516_wdog_insn_read and fix the function to return the status value insn->n times like the comedi core expects. 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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_1516.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_1516.c b/drivers/staging/comedi/drivers/addi_apci_1516.c
index 66207a1..49b2f5c 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1516.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1516.c
@@ -169,14 +169,17 @@ static int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev,
return insn->n;
}
-static int i_APCI1516_ReadWatchdog(struct comedi_device *dev,
+static int apci1516_wdog_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
struct apci1516_private *devpriv = dev->private;
+ int i;
+
+ for (i = 0; i < insn->n; i++)
+ data[i] = inw(devpriv->wdog_iobase + APCI1516_WDOG_STATUS_REG);
- data[0] = inw(devpriv->wdog_iobase + APCI1516_WDOG_STATUS_REG) & 0x1;
return insn->n;
}
@@ -275,7 +278,7 @@ static int __devinit apci1516_auto_attach(struct comedi_device *dev,
s->maxdata = 0;
s->range_table = &range_digital;
s->insn_write = i_APCI1516_StartStopWriteWatchdog;
- s->insn_read = i_APCI1516_ReadWatchdog;
+ s->insn_read = apci1516_wdog_insn_read;
s->insn_config = i_APCI1516_ConfigWatchdog;
} else {
s->type = COMEDI_SUBD_UNUSED;