summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2004-08-26 20:43:02 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-26 20:43:02 -0700
commitfec18575fbb0faf522afbf5b5288962a79ed542f (patch)
treeac3e77c45999805a6415303aef2861d5e26b9121
parentc9bee9d91b1bc1f6a2e6aace13852d3a6cb89797 (diff)
[PATCH] dvb pci_enable_device() fix
Call pci_enable_device() before looking at pci_dev. Also, call pci_disable_device() when releasing the device. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/media/dvb/bt8xx/bt878.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c
index 1619f4c3f31d..16db670532c9 100644
--- a/drivers/media/dvb/bt8xx/bt878.c
+++ b/drivers/media/dvb/bt8xx/bt878.c
@@ -417,6 +417,8 @@ static int __devinit bt878_probe(struct pci_dev *dev,
printk(KERN_INFO "bt878: Bt878 AUDIO function found (%d).\n",
bt878_num);
+ if (pci_enable_device(dev))
+ return -EIO;
bt = &bt878[bt878_num];
bt->dev = dev;
@@ -426,11 +428,10 @@ static int __devinit bt878_probe(struct pci_dev *dev,
bt->id = dev->device;
bt->irq = dev->irq;
bt->bt878_adr = pci_resource_start(dev, 0);
- if (pci_enable_device(dev))
- return -EIO;
if (!request_mem_region(pci_resource_start(dev, 0),
pci_resource_len(dev, 0), "bt878")) {
- return -EBUSY;
+ result = -EBUSY;
+ goto fail0;
}
pci_read_config_byte(dev, PCI_CLASS_REVISION, &bt->revision);
@@ -501,6 +502,8 @@ static int __devinit bt878_probe(struct pci_dev *dev,
fail1:
release_mem_region(pci_resource_start(bt->dev, 0),
pci_resource_len(bt->dev, 0));
+ fail0:
+ pci_disable_device(dev);
return result;
}
@@ -540,6 +543,7 @@ static void __devexit bt878_remove(struct pci_dev *pci_dev)
bt878_mem_free(bt);
pci_set_drvdata(pci_dev, NULL);
+ pci_disable_device(pci_dev);
return;
}