Commit b6ede054 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4dc3a892
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment