mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
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 <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4dc3a8920c
commit
b6ede05458
1 changed files with 3 additions and 17 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue