[<prev] [next>] [day] [month] [year] [list]
Message-ID: <201206261811.00126.hartleys@visionengravers.com>
Date: Tue, 26 Jun 2012 18:10:59 -0700
From: H Hartley Sweeten <hartleys@...ionengravers.com>
To: Linux Kernel <linux-kernel@...r.kernel.org>
CC: <devel@...verdev.osuosl.org>, <abbotti@....co.uk>,
<fmhess@...rs.sourceforge.net>, <gregkh@...uxfoundation.org>
Subject: [PATCH 34/36] staging: comedi: cb_pcidas: cleanup cb_pcidas_ao_nofifo_winsn()
Create local variables for the channel and range in order to
cleanup to mask/set of the ao_control_bits.
Remove the extra space in all the comments.
Return the number of data parameters used (insn->n) to indicate
success instead of the open coded '1'.
Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
Cc: Ian Abbott <abbotti@....co.uk>
Cc: Frank Mori Hess <fmhess@...rs.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/staging/comedi/drivers/cb_pcidas.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index bbbb9e4..b00ccad 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -471,25 +471,25 @@ static int cb_pcidas_ao_nofifo_winsn(struct comedi_device *dev,
unsigned int *data)
{
struct cb_pcidas_private *devpriv = dev->private;
- int channel;
+ unsigned int chan = CR_CHAN(insn->chanspec);
+ unsigned int range = CR_RANGE(insn->chanspec);
unsigned long flags;
- /* set channel and range */
- channel = CR_CHAN(insn->chanspec);
+ /* set channel and range */
spin_lock_irqsave(&dev->spinlock, flags);
- devpriv->ao_control_bits &=
- ~DAC_MODE_UPDATE_BOTH & ~DAC_RANGE_MASK(channel);
- devpriv->ao_control_bits |=
- DACEN | DAC_RANGE(channel, CR_RANGE(insn->chanspec));
+ devpriv->ao_control_bits &= (~DAC_MODE_UPDATE_BOTH &
+ ~DAC_RANGE_MASK(chan));
+ devpriv->ao_control_bits |= (DACEN | DAC_RANGE(chan, range));
outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR);
spin_unlock_irqrestore(&dev->spinlock, flags);
- /* remember value for readback */
- devpriv->ao_value[channel] = data[0];
- /* send data */
- outw(data[0], devpriv->ao_registers + DAC_DATA_REG(channel));
+ /* remember value for readback */
+ devpriv->ao_value[chan] = data[0];
+
+ /* send data */
+ outw(data[0], devpriv->ao_registers + DAC_DATA_REG(chan));
- return 1;
+ return insn->n;
}
/* analog output insn for pcidas-1602 series */
--
1.7.11
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists