[PATCH 02/48] staging: comedi: pcmmio: tidy up switch_page()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 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 850b8f1..a279920 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);
 }
 
-- 
1.8.4.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux