diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-05-14 14:26:28 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 16:25:58 -0700 |
commit | 9d231df80dbaa9918061310149c24bfc3864ca96 (patch) | |
tree | 0181f8c3c60e54553bc40875724a7da5fc1b44c3 /drivers/staging | |
parent | 687d84798de4c202c104db888b33e956bb5b883d (diff) |
staging: comedi: dt9812: pass the comedi_device * to dt9812_analog_out()
For aesthetic reasons, instead of passing the struct usb_dt9812 pointer,
pass the comedi_device pointer to this function and rename the local
variable '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 | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c index 965e96ddb8d1..3e471baaea0e 100644 --- a/drivers/staging/comedi/drivers/dt9812.c +++ b/drivers/staging/comedi/drivers/dt9812.c @@ -603,9 +603,11 @@ static int dt9812_analog_out_shadow(struct slot_dt9812 *slot, int channel, return result; } -static int dt9812_analog_out(struct slot_dt9812 *slot, int channel, u16 value) +static int dt9812_analog_out(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) { @@ -648,12 +650,12 @@ static int dt9812_analog_out(struct slot_dt9812 *slot, int channel, u16 value) rmw[2].or_value = (value >> 8) & 0xf; break; } - result = dt9812_rmw_multiple_registers(slot->usb, 3, rmw); + ret = dt9812_rmw_multiple_registers(slot->usb, 3, rmw); slot->usb->analog_out_shadow[channel] = value; } up(&slot->mutex); - return result; + return ret; } static int dt9812_di_rinsn(struct comedi_device *dev, @@ -727,12 +729,11 @@ static int dt9812_ao_winsn(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; for (n = 0; n < insn->n; n++) - dt9812_analog_out(devpriv->slot, channel, data[n]); + dt9812_analog_out(dev, channel, data[n]); return n; } |