diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-12-19 16:32:07 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-20 11:49:34 -0800 |
commit | d783a20e8f2ada1b0b443ddf09e7e700d20b18dc (patch) | |
tree | 577237ce8bcf6c105b349130d94718bafffd7052 /drivers/staging/comedi | |
parent | 0c26c7ed7621b103419f1f23b52ff78af5ca44a3 (diff) |
staging: comedi: ni_660x: remove dma_selection_counter()
The counter->chip_index will always be < counters_per_chip due to the
initialization of the subdevices during the attach of the board.
The dma_selection_counter() helper just does a BUG_ON() check before
returning the original value. Just use the original value directly
in the caller and remove the helper function.
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')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_660x.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 9437e9440d04..40402c14ba93 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -347,11 +347,6 @@ static inline unsigned dma_select_mask(unsigned dma_channel) enum dma_selection { dma_selection_none = 0x1f, }; -static inline unsigned dma_selection_counter(unsigned counter_index) -{ - BUG_ON(counter_index >= counters_per_chip); - return counter_index; -} static inline unsigned dma_select_bits(unsigned dma_channel, unsigned selection) { @@ -674,10 +669,9 @@ static inline void ni_660x_set_dma_channel(struct comedi_device *dev, spin_lock_irqsave(&devpriv->soft_reg_copy_lock, flags); devpriv->dma_configuration_soft_copies[chip] &= - ~dma_select_mask(mite_channel); + ~dma_select_mask(mite_channel); devpriv->dma_configuration_soft_copies[chip] |= - dma_select_bits(mite_channel, - dma_selection_counter(counter->counter_index)); + dma_select_bits(mite_channel, counter->counter_index); ni_660x_write_register(dev, chip, devpriv->dma_configuration_soft_copies[chip] | dma_reset_bit(mite_channel), NI660X_DMA_CFG); |