From: H Hartley Sweeten Date: Fri, 30 Aug 2013 18:46:53 +0000 (-0700) Subject: staging: comedi: comedi_parport: remove 'enable_irq' from private data X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b6ede0545894aa4d363875b9fb087d06e52b9cac;p=openwrt%2Fstaging%2Fblogic.git staging: comedi: comedi_parport: remove 'enable_irq' from private data The enabled state of the interrupt can be checked by reading the control register. Remove 'enabled_irq' from the private data. Since the private data is now empty, remove it completely and remove the allocation of it in parport_attach(). 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 6d8fb29848ae..33b3b9017546 100644 --- a/drivers/staging/comedi/drivers/comedi_parport.c +++ b/drivers/staging/comedi/drivers/comedi_parport.c @@ -91,10 +91,6 @@ pin, which can be used to wake up tasks. #define PARPORT_CTRL_IRQ_ENA (1 << 4) #define PARPORT_CTRL_BIDIR_ENA (1 << 5) -struct parport_private { - int enable_irq; -}; - static int parport_data_reg_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, @@ -212,40 +208,35 @@ static int parport_intr_cmdtest(struct comedi_device *dev, static int parport_intr_cmd(struct comedi_device *dev, struct comedi_subdevice *s) { - struct parport_private *devpriv = dev->private; unsigned int ctrl; ctrl = inb(dev->iobase + PARPORT_CTRL_REG); ctrl |= PARPORT_CTRL_IRQ_ENA; outb(ctrl, dev->iobase + PARPORT_CTRL_REG); - devpriv->enable_irq = 1; - return 0; } static int parport_intr_cancel(struct comedi_device *dev, struct comedi_subdevice *s) { - struct parport_private *devpriv = dev->private; unsigned int ctrl; ctrl = inb(dev->iobase + PARPORT_CTRL_REG); ctrl &= ~PARPORT_CTRL_IRQ_ENA; outb(ctrl, dev->iobase + PARPORT_CTRL_REG); - devpriv->enable_irq = 0; - return 0; } static irqreturn_t parport_interrupt(int irq, void *d) { struct comedi_device *dev = d; - struct parport_private *devpriv = dev->private; struct comedi_subdevice *s = &dev->subdevices[3]; + unsigned int ctrl; - if (!devpriv->enable_irq) + ctrl = inb(dev->iobase + PARPORT_CTRL_REG); + if (!(ctrl & PARPORT_CTRL_IRQ_ENA)) return IRQ_NONE; comedi_buf_put(s->async, 0); @@ -258,7 +249,6 @@ static irqreturn_t parport_interrupt(int irq, void *d) static int parport_attach(struct comedi_device *dev, struct comedi_devconfig *it) { - struct parport_private *devpriv; struct comedi_subdevice *s; unsigned int irq; int ret; @@ -282,10 +272,6 @@ static int parport_attach(struct comedi_device *dev, if (ret) return ret; - devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); - if (!devpriv) - return -ENOMEM; - s = &dev->subdevices[0]; s->type = COMEDI_SUBD_DIO; s->subdev_flags = SDF_READABLE | SDF_WRITABLE;