The irq parameter passed to i_pci_card_data() is used to get the pci_dev irq that is cached in the card data. This information can easily be found when needed in i_ADDI_Attach() from the 'card' pointer to the card data. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- .../staging/comedi/drivers/addi-data/addi_amcc_s5933.h | 7 ++----- drivers/staging/comedi/drivers/addi-data/addi_common.c | 15 ++++++--------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h b/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h index b09b8e5..0d10ec7 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h +++ b/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h @@ -231,8 +231,7 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id, int pci_card_alloc(struct pcilst_struct *amcc, int master); int i_pci_card_free(struct pcilst_struct *amcc); int i_pci_card_data(struct pcilst_struct *amcc, - resource_size_t *io_addr, - unsigned int *irq); + resource_size_t *io_addr); /****************************************************************************/ @@ -382,8 +381,7 @@ int i_pci_card_free(struct pcilst_struct *amcc) /****************************************************************************/ /* return all card information for driver */ int i_pci_card_data(struct pcilst_struct *amcc, - resource_size_t *io_addr, - unsigned int *irq) + resource_size_t *io_addr) { int i; @@ -391,7 +389,6 @@ int i_pci_card_data(struct pcilst_struct *amcc, return -1; for (i = 0; i < 5; i++) io_addr[i] = amcc->io_addr[i]; - *irq = amcc->irq; return 0; } diff --git a/drivers/staging/comedi/drivers/addi-data/addi_common.c b/drivers/staging/comedi/drivers/addi-data/addi_common.c index 33159ec..8ebfb2b 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_common.c +++ b/drivers/staging/comedi/drivers/addi-data/addi_common.c @@ -92,7 +92,6 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) int ret, pages, i, n_subdevices; unsigned int dw_Dummy; resource_size_t io_addr[5]; - unsigned int irq; resource_size_t iobase_a, iobase_main, iobase_addon, iobase_reserved; struct pcilst_struct *card = NULL; int i_Dma = 0; @@ -121,7 +120,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) devpriv->allocated = 1; - if ((i_pci_card_data(card, &io_addr[0], &irq)) < 0) { + if ((i_pci_card_data(card, &io_addr[0])) < 0) { i_pci_card_free(card); return -EIO; } @@ -176,15 +175,13 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) /* ## */ - if (irq > 0) { - if (request_irq(irq, v_ADDI_Interrupt, IRQF_SHARED, - this_board->pc_DriverName, dev) < 0) { - irq = 0; /* Can't use IRQ */ - } + if (card->irq > 0) { + ret = request_irq(card->irq, v_ADDI_Interrupt, IRQF_SHARED, + this_board->pc_DriverName, dev); + if (ret == 0) + dev->irq = card->irq; } - dev->irq = irq; - /* Read eepeom and fill addi_board Structure */ if (this_board->i_PCIEeprom) { -- 1.7.11 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel