summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/gsc_hpdi.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2014-03-13 14:16:25 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-17 14:19:50 -0700
commitab5cf493170e2d7d0f4a74467009d55e63cd1a71 (patch)
tree26968127753168557fcaaab00ae5bc1444f3a543 /drivers/staging/comedi/drivers/gsc_hpdi.c
parent42ea78126c3f6c7a51fdf2c970e1d67f0a5faa19 (diff)
staging: comedi: gsc_hpdi: remove hpdi_writel()
This helper function is used to OR bits with a software copy of a register value then writel() the new value to the register. The software copies are never updated in the driver so they are always 0 due to the kzalloc. Remove the unnecessary 'bits' from the private data and replace the hpdi_writel() calls with writel(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/gsc_hpdi.c')
-rw-r--r--drivers/staging/comedi/drivers/gsc_hpdi.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
index 3762510933dc..aaf6283e5aaf 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -203,21 +203,10 @@ struct hpdi_private {
unsigned int tx_fifo_size;
unsigned int rx_fifo_size;
volatile unsigned long dio_count;
- /* software copies of values written to hpdi registers */
- volatile uint32_t bits[24];
/* number of bytes at which to generate COMEDI_CB_BLOCK events */
volatile unsigned int block_size;
};
-static inline void hpdi_writel(struct comedi_device *dev, uint32_t bits,
- unsigned int offset)
-{
- struct hpdi_private *devpriv = dev->private;
-
- writel(bits | devpriv->bits[offset / sizeof(uint32_t)],
- devpriv->hpdi_iobase + offset);
-}
-
static void gsc_hpdi_drain_dma(struct comedi_device *dev, unsigned int channel)
{
struct hpdi_private *devpriv = dev->private;
@@ -350,8 +339,7 @@ static int gsc_hpdi_cancel(struct comedi_device *dev,
{
struct hpdi_private *devpriv = dev->private;
- hpdi_writel(dev, 0, BOARD_CONTROL_REG);
-
+ writel(0, devpriv->hpdi_iobase + BOARD_CONTROL_REG);
writel(0, devpriv->hpdi_iobase + INTERRUPT_CONTROL_REG);
gsc_hpdi_abort_dma(dev, 0);
@@ -371,7 +359,7 @@ static int gsc_hpdi_cmd(struct comedi_device *dev,
if (s->io_bits)
return -EINVAL;
- hpdi_writel(dev, RX_FIFO_RESET_BIT, BOARD_CONTROL_REG);
+ writel(RX_FIFO_RESET_BIT, devpriv->hpdi_iobase + BOARD_CONTROL_REG);
gsc_hpdi_abort_dma(dev, 0);
@@ -411,7 +399,7 @@ static int gsc_hpdi_cmd(struct comedi_device *dev,
writel(intr_bit(RX_FULL_INTR),
devpriv->hpdi_iobase + INTERRUPT_CONTROL_REG);
- hpdi_writel(dev, RX_ENABLE_BIT, BOARD_CONTROL_REG);
+ writel(RX_ENABLE_BIT, devpriv->hpdi_iobase + BOARD_CONTROL_REG);
return 0;
}