[PATCH v2 02/15] staging: comedi: comedi_parport: remove 'a_data' from private data

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

 



Use the subdevice s->state to hold the current state of the data register
outputs instead of carrying it in the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/comedi_parport.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_parport.c b/drivers/staging/comedi/drivers/comedi_parport.c
index 72b0771..5565a99 100644
--- a/drivers/staging/comedi/drivers/comedi_parport.c
+++ b/drivers/staging/comedi/drivers/comedi_parport.c
@@ -92,7 +92,6 @@ pin, which can be used to wake up tasks.
 #define PARPORT_CTRL_BIDIR_ENA	(1 << 5)
 
 struct parport_private {
-	unsigned int a_data;
 	unsigned int c_data;
 	int enable_irq;
 };
@@ -100,13 +99,11 @@ struct parport_private {
 static int parport_insn_a(struct comedi_device *dev, struct comedi_subdevice *s,
 			  struct comedi_insn *insn, unsigned int *data)
 {
-	struct parport_private *devpriv = dev->private;
-
 	if (data[0]) {
-		devpriv->a_data &= ~data[0];
-		devpriv->a_data |= (data[0] & data[1]);
+		s->state &= ~data[0];
+		s->state |= (data[0] & data[1]);
 
-		outb(devpriv->a_data, dev->iobase + PARPORT_DATA_REG);
+		outb(s->state, dev->iobase + PARPORT_DATA_REG);
 	}
 
 	data[1] = inb(dev->iobase + PARPORT_DATA_REG);
@@ -327,8 +324,7 @@ static int parport_attach(struct comedi_device *dev,
 		s->type = COMEDI_SUBD_UNUSED;
 	}
 
-	devpriv->a_data = 0;
-	outb(devpriv->a_data, dev->iobase + PARPORT_DATA_REG);
+	outb(0, dev->iobase + PARPORT_DATA_REG);
 	devpriv->c_data = 0;
 	outb(devpriv->c_data, dev->iobase + PARPORT_CTRL_REG);
 
-- 
1.8.3.2

_______________________________________________
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