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

staging: comedi: addi_common.c: remove v_ADDI_Interrupt()

The addi_apci_035 and addi_apci_1500 are the only drivers left that use
this function in addi_common.c. The function simply calls the 'interrupt'
function that is in the boardinfo of the driver. Both drivers use the
same 'interrupt' function for all boardnfo entries.

Remove the i_ADDI_Reset() function as well as the 'interrupt' boardinfo
and use the 'interrupt' function directly when doing the request_irq().

In addition, the addi_apci_3120 driver has a private v_ADDI_Interrupt()
function that is doing the same thing. Remove that one as well.

Fix the return type of 'interrupt' functions in the drivers and add the
return vaules.
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 3c3dcdd7
......@@ -55,12 +55,3 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev,
return insn->n;
}
static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
const struct addi_board *this_board = dev->board_ptr;
this_board->interrupt(irq, d);
return IRQ_RETVAL(1);
}
......@@ -434,7 +434,7 @@ static int apci035_reset(struct comedi_device *dev)
return 0;
}
static void apci035_interrupt(int irq, void *d)
static irqreturn_t apci035_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private;
......@@ -477,4 +477,6 @@ static void apci035_interrupt(int irq, void *d)
/* send signal to the sample */
send_sig(SIGIO, devpriv->tsk_Current, 0);
}
return IRQ_HANDLED;
}
......@@ -2011,7 +2011,7 @@ static int apci1500_do_bits(struct comedi_device *dev,
return insn->n;
}
static void apci1500_interrupt(int irq, void *d)
static irqreturn_t apci1500_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
......@@ -2180,6 +2180,8 @@ static void apci1500_interrupt(int irq, void *d)
"Interrupt from unknown source\n");
}
return IRQ_HANDLED;
}
static int apci1500_reset(struct comedi_device *dev)
......
......@@ -1415,7 +1415,7 @@ static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
return 0;
}
static void apci3120_interrupt(int irq, void *d)
static irqreturn_t apci3120_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private;
......@@ -1432,7 +1432,7 @@ static void apci3120_interrupt(int irq, void *d)
if ((!int_daq) && (!(int_amcc & ANY_S593X_INT))) {
dev_err(dev->class_dev, "IRQ from unknown source\n");
return;
return IRQ_NONE;
}
outl(int_amcc | 0x00ff0000, devpriv->i_IobaseAmcc + AMCC_OP_REG_INTCSR); /* shutdown IRQ reasons in AMCC */
......@@ -1587,6 +1587,8 @@ static void apci3120_interrupt(int irq, void *d)
}
comedi_handle_events(dev, s);
return IRQ_HANDLED;
}
/*
......
......@@ -27,7 +27,6 @@ static const struct addi_board apci035_boardtypes[] = {
.i_Timer = 1,
.ui_MinAcquisitiontimeNs = 10000,
.ui_MinDelaytimeNs = 100000,
.interrupt = apci035_interrupt,
.ai_config = apci035_ai_config,
.ai_read = apci035_ai_read,
.timer_config = apci035_timer_config,
......@@ -84,7 +83,7 @@ static int apci035_auto_attach(struct comedi_device *dev,
/* ## */
if (pcidev->irq > 0) {
ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
ret = request_irq(pcidev->irq, apci035_interrupt, IRQF_SHARED,
dev->board_name, dev);
if (ret == 0)
dev->irq = pcidev->irq;
......
......@@ -20,7 +20,6 @@ static const struct addi_board apci1500_boardtypes[] = {
.i_NbrDoChannel = 16,
.i_DoMaxdata = 0xffff,
.i_Timer = 1,
.interrupt = apci1500_interrupt,
.di_config = apci1500_di_config,
.di_read = apci1500_di_read,
.di_write = apci1500_di_write,
......@@ -83,7 +82,7 @@ static int apci1500_auto_attach(struct comedi_device *dev,
/* ## */
if (pcidev->irq > 0) {
ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
ret = request_irq(pcidev->irq, apci1500_interrupt, IRQF_SHARED,
dev->board_name, dev);
if (ret == 0)
dev->irq = pcidev->irq;
......
......@@ -26,7 +26,6 @@ static const struct addi_board apci3120_boardtypes[] = {
.i_NbrDiChannel = 4,
.i_NbrDoChannel = 4,
.i_DoMaxdata = 0x0f,
.interrupt = apci3120_interrupt,
},
[BOARD_APCI3001] = {
.pc_DriverName = "apci3001",
......@@ -37,19 +36,9 @@ static const struct addi_board apci3120_boardtypes[] = {
.i_NbrDiChannel = 4,
.i_NbrDoChannel = 4,
.i_DoMaxdata = 0x0f,
.interrupt = apci3120_interrupt,
},
};
static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
const struct addi_board *this_board = dev->board_ptr;
this_board->interrupt(irq, d);
return IRQ_RETVAL(1);
}
static int apci3120_auto_attach(struct comedi_device *dev,
unsigned long context)
{
......@@ -82,7 +71,7 @@ static int apci3120_auto_attach(struct comedi_device *dev,
devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
if (pcidev->irq > 0) {
ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
ret = request_irq(pcidev->irq, apci3120_interrupt, IRQF_SHARED,
dev->board_name, dev);
if (ret == 0)
dev->irq = pcidev->irq;
......
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