Commit 7645694c authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcmmio: tidy up switch_page()

All the I/O ports are left unlocked in the driver so the 'pagelock'
in the private data is not necessary. The paranoia sanity checks
are also unnecessary, Remove them.
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 2ab62fdf
......@@ -213,7 +213,6 @@ struct pcmmio_subdev_private {
struct pcmmio_private {
/* stuff for DIO */
struct {
unsigned char pagelock; /* current page and lock */
/* shadow of POLx registers */
unsigned char pol[NUM_PAGED_REGS];
/* shadow of ENABx registers */
......@@ -318,16 +317,7 @@ static void switch_page(struct comedi_device *dev, int asic, int page)
{
struct pcmmio_private *devpriv = dev->private;
if (asic < 0 || asic >= 1)
return; /* paranoia */
if (page < 0 || page >= NUM_PAGES)
return; /* more paranoia */
devpriv->asics[asic].pagelock &= ~REG_PAGE_MASK;
devpriv->asics[asic].pagelock |= page << REG_PAGE_BITOFFSET;
/* now write out the shadow register */
outb(devpriv->asics[asic].pagelock,
outb(page << REG_PAGE_BITOFFSET,
devpriv->asics[asic].iobase + REG_PAGELOCK);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment