Skip to content

Commit

Permalink
staging: comedi: rtd520: remove RtdAdcClearFifo macro
Browse files Browse the repository at this point in the history
This macro uses the 'devpriv' macro which relies on a local variable
having a specific name. Plus it's just a wrapper around a simple
'writel'. Remove the macro.

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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 13, 2012
1 parent 9b3f95c commit aa5372b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions drivers/staging/comedi/drivers/rtd520.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,6 @@ struct rtdPrivate {

/* Macros to access registers */

/* Reset ADC FIFO */
#define RtdAdcClearFifo(dev) \
writel(0, devpriv->las0+LAS0_ADC_FIFO_CLEAR)

/* Set ADC start conversion source select (write only) */
#define RtdAdcConversionSource(dev, v) \
writel(v, devpriv->las0+LAS0_ADC_CONVERSION)
Expand Down Expand Up @@ -804,7 +800,7 @@ static int rtd520_probe_fifo_depth(struct comedi_device *dev)
static const unsigned limit = 0x2000;
unsigned fifo_size = 0;

RtdAdcClearFifo(dev);
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);
rtd_load_channelgain_list(dev, 1, &chanspec);
RtdAdcConversionSource(dev, 0); /* software */
/* convert samples */
Expand All @@ -824,7 +820,7 @@ static int rtd520_probe_fifo_depth(struct comedi_device *dev)
DRV_NAME);
return -EIO;
}
RtdAdcClearFifo(dev);
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);
if (fifo_size != 0x400 && fifo_size != 0x2000) {
printk
(KERN_INFO "\ncomedi: %s: unexpected fifo size of %i, expected 1024 or 8192.\n",
Expand All @@ -850,7 +846,7 @@ static int rtd_ai_rinsn(struct comedi_device *dev,
int stat;

/* clear any old fifo data */
RtdAdcClearFifo(dev);
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);

/* write channel to multiplexer and clear channel gain table */
rtd_load_channelgain_list(dev, 1, &insn->chanspec);
Expand Down Expand Up @@ -1204,7 +1200,7 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */
return IRQ_HANDLED;

abortTransfer:
RtdAdcClearFifo(dev); /* clears full flag */
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);
s->async->events |= COMEDI_CB_ERROR;
devpriv->aiCount = 0; /* stop and don't transfer any more */
/* fall into transferDone */
Expand Down Expand Up @@ -1495,7 +1491,7 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
}
RtdDma0Reset(dev); /* reset onboard state */
#endif /* USE_DMA */
RtdAdcClearFifo(dev); /* clear any old data */
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);
RtdInterruptOverrunClear(dev);
devpriv->intCount = 0;

Expand Down Expand Up @@ -2036,7 +2032,7 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
RtdInterruptClear(dev); /* clears bits set by mask */
RtdInterruptOverrunClear(dev);
writel(0, devpriv->las0 + LAS0_CGT_CLEAR);
RtdAdcClearFifo(dev);
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);
RtdDacClearFifo(dev, 0);
RtdDacClearFifo(dev, 1);
/* clear digital IO fifo */
Expand Down

0 comments on commit aa5372b

Please sign in to comment.