[PATCH 77/87] staging: comedi: pcl816: rename 'irq_blocked' in private data

H Hartley Sweeten hsweeten at visionengravers.com
Mon Feb 17 21:27:51 UTC 2014


This member in the private data is a flag that indicates that an analog
input async command is currently running. Rename it to make this clear.

The private data is kzalloc'ed in the attach so remove the unnecessary
clearing of this flag.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/staging/comedi/drivers/pcl816.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c
index 96043f8..f1a81f0 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -119,7 +119,7 @@ struct pcl816_private {
 	unsigned int ai_poll_ptr;	/*  how many sampes transfer poll */
 	unsigned int divisor1;
 	unsigned int divisor2;
-	unsigned int irq_blocked:1;
+	unsigned int ai_cmd_running:1;
 	unsigned int irq_was_now_closed:1;
 	unsigned int ai_neverending:1;
 };
@@ -367,7 +367,7 @@ static irqreturn_t interrupt_pcl816(int irq, void *d)
 	}
 
 	outb(0, dev->iobase + PCL816_CLRINT);	/* clear INT request */
-	if (!dev->irq || !devpriv->irq_blocked || !devpriv->int816_mode) {
+	if (!dev->irq || !devpriv->ai_cmd_running || !devpriv->int816_mode) {
 		if (devpriv->irq_was_now_closed) {
 			devpriv->irq_was_now_closed = 0;
 			/*  comedi_error(dev,"last IRQ.."); */
@@ -468,7 +468,7 @@ static int pcl816_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	unsigned int dma_flags, bytes, dmairq;
 	unsigned int seglen;
 
-	if (devpriv->irq_blocked)
+	if (devpriv->ai_cmd_running)
 		return -EBUSY;
 
 	pcl816_start_pacer(dev, false);
@@ -481,7 +481,7 @@ static int pcl816_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
 	devpriv->ai_act_scan = 0;
 	s->async->cur_chan = 0;
-	devpriv->irq_blocked = 1;
+	devpriv->ai_cmd_running = 1;
 	devpriv->ai_poll_ptr = 0;
 	devpriv->irq_was_now_closed = 0;
 
@@ -598,7 +598,7 @@ static int pcl816_ai_cancel(struct comedi_device *dev,
 {
 	struct pcl816_private *devpriv = dev->private;
 
-	if (devpriv->irq_blocked > 0) {
+	if (devpriv->ai_cmd_running) {
 		switch (devpriv->int816_mode) {
 		case INT_TYPE_AI1_DMA:
 		case INT_TYPE_AI3_DMA:
@@ -624,7 +624,7 @@ static int pcl816_ai_cancel(struct comedi_device *dev,
 
 			/* Stop A/D */
 			outb(0, dev->iobase + PCL816_CONTROL);
-			devpriv->irq_blocked = 0;
+			devpriv->ai_cmd_running = 0;
 			devpriv->irq_was_now_closed = 1;
 			devpriv->int816_mode = 0;
 /* s->busy = 0; */
@@ -799,7 +799,6 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			dev->irq = it->options[1];
 	}
 
-	devpriv->irq_blocked = 0;	/* number of subdevice which use IRQ */
 	devpriv->int816_mode = 0;	/* mode of irq */
 
 	/* we need an IRQ to do DMA on channel 3 or 1 */
-- 
1.8.5.2



More information about the devel mailing list