Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318065
b: refs/heads/master
c: e10355b
h: refs/heads/master
i:
  318063: 2f75be9
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent ab376cb commit d9fead0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54b303c45d43d5b4ca69de843fb2d1a7160578f9
refs/heads/master: e10355b946a5b685ca16be7d7ba31e9571233bee
39 changes: 1 addition & 38 deletions trunk/drivers/staging/comedi/drivers/adv_pci_dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,6 @@ static const struct dio_boardtype boardtypes[] = {
};

struct pci_dio_private {
struct pci_dio_private *prev; /* previous private struct */
struct pci_dio_private *next; /* next private struct */
struct pci_dev *pcidev; /* pointer to board's pci_dev */
char valid; /* card is usable */
char GlobalIrqEnabled; /* 1= any IRQ source is enabled */
Expand All @@ -404,8 +402,6 @@ struct pci_dio_private {
unsigned short IDIFiltrHigh[8]; /* IDI's filter value high signal */
};

static struct pci_dio_private *pci_priv; /* list of allocated cards */

#define devpriv ((struct pci_dio_private *)dev->private)
#define this_board ((const struct dio_boardtype *)dev->board_ptr)

Expand Down Expand Up @@ -1055,38 +1051,12 @@ static int pci_dio_add_8254(struct comedi_device *dev,
return 0;
}

/*
==============================================================================
*/
static int CheckAndAllocCard(struct comedi_device *dev,
struct comedi_devconfig *it,
struct pci_dev *pcidev)
{
struct pci_dio_private *pr, *prev;

for (pr = pci_priv, prev = NULL; pr != NULL; prev = pr, pr = pr->next) {
if (pr->pcidev == pcidev)
return 0; /* this card is used, look for another */

}

if (prev) {
devpriv->prev = prev;
prev->next = devpriv;
} else {
pci_priv = devpriv;
}

return 1;
}

static struct pci_dev *pci_dio_find_pci_dev(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev = NULL;
unsigned long iobase;
int i;
int ret;

for_each_pci_dev(pcidev) {
/* loop through cards supported by this driver */
Expand All @@ -1103,8 +1073,7 @@ static struct pci_dev *pci_dio_find_pci_dev(struct comedi_device *dev,
continue;
}
}
ret = CheckAndAllocCard(dev, it, pcidev);
if (ret != 1)
if (pci_is_enabled(pcidev))
continue;
dev->board_ptr = boardtypes + i;
break;
Expand Down Expand Up @@ -1260,12 +1229,6 @@ static void pci_dio_detach(struct comedi_device *dev)
comedi_pci_disable(devpriv->pcidev);
pci_dev_put(devpriv->pcidev);
}
if (devpriv->prev)
devpriv->prev->next = devpriv->next;
else
pci_priv = devpriv->next;
if (devpriv->next)
devpriv->next->prev = devpriv->prev;
}
}

Expand Down

0 comments on commit d9fead0

Please sign in to comment.