Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325318
b: refs/heads/master
c: a5cf79e
h: refs/heads/master
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Sep 17, 2012
1 parent 6cc4554 commit b39d993
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 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: f822a6a1a11759f0a694a4a3547c1186e1a2eaec
refs/heads/master: a5cf79e3ace423360126a4eeb5089c19c99ae060
22 changes: 5 additions & 17 deletions trunk/drivers/staging/comedi/drivers/ni_pcimio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,25 +1581,13 @@ static void pcimio_detach(struct comedi_device *dev)
mite_free_ring(devpriv->cdo_mite_ring);
mite_free_ring(devpriv->gpct_mite_ring[0]);
mite_free_ring(devpriv->gpct_mite_ring[1]);
if (devpriv->mite)
if (devpriv->mite) {
mite_unsetup(devpriv->mite);
mite_free(devpriv->mite);
}
}
}

/* FIXME: remove this when dynamic MITE allocation implemented. */
static struct mite_struct *pcimio_find_mite(struct pci_dev *pcidev)
{
struct mite_struct *mite;

for (mite = mite_devices; mite; mite = mite->next) {
if (mite->used)
continue;
if (mite->pcidev == pcidev)
return mite;
}
return NULL;
}

static const struct ni_board_struct *
pcimio_find_boardinfo(struct pci_dev *pcidev)
{
Expand Down Expand Up @@ -1629,9 +1617,9 @@ static int __devinit pcimio_attach_pci(struct comedi_device *dev,
if (!dev->board_ptr)
return -ENODEV;

devpriv->mite = pcimio_find_mite(pcidev);
devpriv->mite = mite_alloc(pcidev);
if (!devpriv->mite)
return -ENODEV;
return -ENOMEM;

dev_dbg(dev->class_dev, "%s\n", boardtype.name);
dev->board_name = boardtype.name;
Expand Down

0 comments on commit b39d993

Please sign in to comment.