From: H Hartley Sweeten Date: Fri, 30 Aug 2013 18:44:43 +0000 (-0700) Subject: staging: comedi: comedi_parport: remove 'a_data' from private data X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9f1a0909deaed0a35dc459f598dafb048331f9d2;p=linux-beck.git staging: comedi: comedi_parport: remove 'a_data' from private data 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/comedi_parport.c b/drivers/staging/comedi/drivers/comedi_parport.c index 72b07717ada1..5565a99c6858 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);