diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-05-14 21:27:16 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 23:25:58 (GMT) |
commit | fad1c32076ae8b82c7b62be5946f98596f7febeb (patch) | |
tree | 703e40636097f6c2df84e3fc60b1c579da56b705 /drivers/staging | |
parent | 387d4879500cfc4b887740643061336916f587fb (diff) | |
download | linux-fsl-qoriq-fad1c32076ae8b82c7b62be5946f98596f7febeb.tar.xz |
staging: comedi: dt9812: pass the comedi_device * to dt9812_analog_out_shadow()
For aesthetic reasons, instead of passing the 'slot' pointer, pass the
comedi_device pointer to this function and rename the local var 'result'
to simply 'ret'.
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')
-rw-r--r-- | drivers/staging/comedi/drivers/dt9812.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c index ac5629c..94ab0c5 100644 --- a/drivers/staging/comedi/drivers/dt9812.c +++ b/drivers/staging/comedi/drivers/dt9812.c @@ -588,19 +588,21 @@ exit: return ret; } -static int dt9812_analog_out_shadow(struct slot_dt9812 *slot, int channel, - u16 *value) +static int dt9812_analog_out_shadow(struct comedi_device *dev, + int channel, u16 *value) { - int result = -ENODEV; + struct dt9812_private *devpriv = dev->private; + struct slot_dt9812 *slot = devpriv->slot; + int ret = -ENODEV; down(&slot->mutex); if (slot->usb) { *value = slot->usb->analog_out_shadow[channel]; - result = 0; + ret = 0; } up(&slot->mutex); - return result; + return ret; } static int dt9812_analog_out(struct comedi_device *dev, int channel, u16 value) @@ -712,14 +714,13 @@ static int dt9812_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - struct dt9812_private *devpriv = dev->private; unsigned int channel = CR_CHAN(insn->chanspec); int n; u16 value; for (n = 0; n < insn->n; n++) { value = 0; - dt9812_analog_out_shadow(devpriv->slot, channel, &value); + dt9812_analog_out_shadow(dev, channel, &value); data[n] = value; } return n; |