Skip to content
Commit c5b970ae authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: pcmmio: tidy up pcmmio_start_intr()



Refactor the function to remove some indent levels.

Use pcmmio_dio_write() to write the polarity and enable paged registers
instead of using the for () loop to write each register in the pages.

The for () loop actually has a bug. It switches the page to the 'enab'
registers for the first port then switches to the 'pol' registers for
all remaining writes. It also was not using the pagelock spinlock to
protect the writes to the page registers. Using the pcmmio_dio_write()
helper ensures that the writes to the paged registers complete correctly.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2eb6b518
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment