提交 fad1c320 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

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: NH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 387d4879
...@@ -588,19 +588,21 @@ static int dt9812_analog_in(struct comedi_device *dev, ...@@ -588,19 +588,21 @@ static int dt9812_analog_in(struct comedi_device *dev,
return ret; return ret;
} }
static int dt9812_analog_out_shadow(struct slot_dt9812 *slot, int channel, static int dt9812_analog_out_shadow(struct comedi_device *dev,
u16 *value) 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); down(&slot->mutex);
if (slot->usb) { if (slot->usb) {
*value = slot->usb->analog_out_shadow[channel]; *value = slot->usb->analog_out_shadow[channel];
result = 0; ret = 0;
} }
up(&slot->mutex); up(&slot->mutex);
return result; return ret;
} }
static int dt9812_analog_out(struct comedi_device *dev, int channel, u16 value) 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, ...@@ -712,14 +714,13 @@ static int dt9812_ao_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct dt9812_private *devpriv = dev->private;
unsigned int channel = CR_CHAN(insn->chanspec); unsigned int channel = CR_CHAN(insn->chanspec);
int n; int n;
u16 value; u16 value;
for (n = 0; n < insn->n; n++) { for (n = 0; n < insn->n; n++) {
value = 0; value = 0;
dt9812_analog_out_shadow(devpriv->slot, channel, &value); dt9812_analog_out_shadow(dev, channel, &value);
data[n] = value; data[n] = value;
} }
return n; return n;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册