]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: addi-data: remove irq parameter from i_pci_card_data()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Wed, 31 Oct 2012 23:55:37 +0000 (16:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Nov 2012 15:43:23 +0000 (08:43 -0700)
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@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h
drivers/staging/comedi/drivers/addi-data/addi_common.c

index b09b8e558b702306f53b6c68f9a04daeb9781e6a..0d10ec7288edda829dd91d3a0ef8d14937dbf0f3 100644 (file)
@@ -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;
 }
 
index 33159eca9113b8b5c427c22ba5b18cbf93b15707..8ebfb2b81b5a5bcedf5805ba2b458efea8adb975 100644 (file)
@@ -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) {