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: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2ab62fdfc3
commit
7645694c69
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue