From 7645694c697cb0425a3590620d0673aa88dc6105 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 9 Dec 2013 15:30:38 -0700 Subject: [PATCH] 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcmmio.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c index 850b8f152a0b..a27992098916 100644 --- a/drivers/staging/comedi/drivers/pcmmio.c +++ b/drivers/staging/comedi/drivers/pcmmio.c @@ -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); } -- 2.30.2