blob: 303c2382ba67b77c3f5e95d8523f62a09272df85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
Index: linux-2.6.23.17/drivers/ide/pci/aec62xx.c
===================================================================
--- linux-2.6.23.17.orig/drivers/ide/pci/aec62xx.c
+++ linux-2.6.23.17/drivers/ide/pci/aec62xx.c
@@ -248,7 +248,14 @@ static int __devinit init_setup_aec62xx(
static int __devinit init_setup_aec6x80(struct pci_dev *dev, ide_pci_device_t *d)
{
- unsigned long dma_base = pci_resource_start(dev, 4);
+ unsigned long dma_base;
+ int err;
+
+ err = pci_enable_device(dev);
+ if (err)
+ return err;
+
+ dma_base = pci_resource_start(dev, 4);
if (inb(dma_base + 2) & 0x10) {
d->name = (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R) ?
@@ -256,7 +263,11 @@ static int __devinit init_setup_aec6x80(
d->udma_mask = 0x7f; /* udma0-6 */
}
- return ide_setup_pci_device(dev, d);
+ err = ide_setup_pci_device(dev, d);
+ if(err)
+ pci_disable_device(dev);
+
+ return err;
}
static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
|