[PATCH 23/29] staging: comedi: addi_apci_1032: cleanup v_ADDI_Interrupt()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no need for this function to call v_APCI1032_Interrupt()
in hwdrv_apci1032.c to reset the board. Just move the code from
v_APCI1032_Interrupt() directly into this function.

Rename the CamelCase function to apci1032_interrupt().

Rename the CamelCase local variable used to read/write the control
register.

Change the return from IRQ_RETVAL(1) to IRQ_HANDLED.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 .../comedi/drivers/addi-data/hwdrv_apci1032.c      | 35 ----------------------
 drivers/staging/comedi/drivers/addi_apci_1032.c    | 22 +++++++++++---
 2 files changed, 18 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
index 3e3c229..6ee5d5d 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
@@ -135,38 +135,3 @@ static int i_APCI1032_ConfigDigitalInput(struct comedi_device *dev,
 
 	return insn->n;
 }
-
-/*
-+----------------------------------------------------------------------------+
-| Function   Name   : static void v_APCI1032_Interrupt					     |
-|					  (int irq , void *d)      |
-+----------------------------------------------------------------------------+
-| Task              : Interrupt handler for the interruptible digital inputs |
-+----------------------------------------------------------------------------+
-| Input Parameters  : int irq                 : irq number                   |
-|                     void *d                 : void pointer                 |
-+----------------------------------------------------------------------------+
-| Output Parameters :	--						     |
-+----------------------------------------------------------------------------+
-| Return Value      : TRUE  : No error occur                                 |
-|		            : FALSE : Error occur. Return the error          |
-|			                                                     |
-+----------------------------------------------------------------------------+
-*/
-static void v_APCI1032_Interrupt(int irq, void *d)
-{
-	struct comedi_device *dev = d;
-	struct addi_private *devpriv = dev->private;
-	unsigned int ui_Temp;
-
-	/* disable the interrupt */
-	ui_Temp = inl(dev->iobase + APCI1032_CTRL_REG);
-	outl(ui_Temp & ~APCI1032_CTRL_INT_ENA,
-		dev->iobase + APCI1032_CTRL_REG);
-	ui_InterruptStatus = inl(dev->iobase + APCI1032_STATUS_REG);
-	ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
-	send_sig(SIGIO, devpriv->tsk_Current, 0);	/*  send signal to the sample */
-	/* enable the interrupt */
-	outl(ui_Temp, dev->iobase + APCI1032_CTRL_REG);
-	return;
-}
diff --git a/drivers/staging/comedi/drivers/addi_apci_1032.c b/drivers/staging/comedi/drivers/addi_apci_1032.c
index 1b4d698..ab34671 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1032.c
@@ -6,10 +6,24 @@
 
 #include "addi-data/hwdrv_apci1032.c"
 
-static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
+static irqreturn_t apci1032_interrupt(int irq, void *d)
 {
-	v_APCI1032_Interrupt(irq, d);
-	return IRQ_RETVAL(1);
+	struct comedi_device *dev = d;
+	struct addi_private *devpriv = dev->private;
+	unsigned int ctrl;
+
+	/* disable the interrupt */
+	ctrl = inl(dev->iobase + APCI1032_CTRL_REG);
+	outl(ctrl & ~APCI1032_CTRL_INT_ENA, dev->iobase + APCI1032_CTRL_REG);
+
+	ui_InterruptStatus = inl(dev->iobase + APCI1032_STATUS_REG);
+	ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
+	send_sig(SIGIO, devpriv->tsk_Current, 0);	/*  send signal to the sample */
+
+	/* enable the interrupt */
+	outl(ctrl, dev->iobase + APCI1032_CTRL_REG);
+
+	return IRQ_HANDLED;
 }
 
 static int apci1032_di_insn_bits(struct comedi_device *dev,
@@ -56,7 +70,7 @@ static int apci1032_attach_pci(struct comedi_device *dev,
 	dev->iobase = pci_resource_start(pcidev, 2);
 
 	if (pcidev->irq > 0) {
-		ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, apci1032_interrupt, IRQF_SHARED,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
-- 
1.7.11

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux