]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: ni_mio_common: simplify ni_m_series_set_pfi_routing()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 1 May 2015 21:58:30 +0000 (14:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 May 2015 17:05:03 +0000 (19:05 +0200)
commite0852f6ac1949f2d2612861ab608a5b1c614150c
tree22cbadb5a8e296497e68834214efa6dbd4925505
parent0a9752d81a636ccd01f473ee8c85b8a05f06a92b
staging: comedi: ni_mio_common: simplify ni_m_series_set_pfi_routing()

This function is overly complex due to the M_Offset_PFI_Output_Select()
helper using a 1 based index for the registers and the private data using
a 0 based index for the cached values.

Modify the M_Offset_PFI_Output_Select() helper to use a 0 based index and
remove the sanity check which can never happen. The 'n' value passed is
calculated from the subdevice channel which will always be in range.

Tidy up the function by using a local variable to mask/set the pfi output
select bits.

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>
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_stc.h