diff options
Diffstat (limited to 'include/asm-i386/ide.h')
-rw-r--r-- | include/asm-i386/ide.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index 73465d2892b9..0fc240c80f49 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h | |||
@@ -40,13 +40,14 @@ static __inline__ int ide_default_irq(unsigned long base) | |||
40 | 40 | ||
41 | static __inline__ unsigned long ide_default_io_base(int index) | 41 | static __inline__ unsigned long ide_default_io_base(int index) |
42 | { | 42 | { |
43 | struct pci_dev *pdev; | ||
43 | /* | 44 | /* |
44 | * If PCI is present then it is not safe to poke around | 45 | * If PCI is present then it is not safe to poke around |
45 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | 46 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are |
46 | * defined compatibility mode ports for PCI. A user can | 47 | * defined compatibility mode ports for PCI. A user can |
47 | * override this using ide= but we must default safe. | 48 | * override this using ide= but we must default safe. |
48 | */ | 49 | */ |
49 | if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) { | 50 | if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) { |
50 | switch(index) { | 51 | switch(index) { |
51 | case 2: return 0x1e8; | 52 | case 2: return 0x1e8; |
52 | case 3: return 0x168; | 53 | case 3: return 0x168; |
@@ -54,6 +55,7 @@ static __inline__ unsigned long ide_default_io_base(int index) | |||
54 | case 5: return 0x160; | 55 | case 5: return 0x160; |
55 | } | 56 | } |
56 | } | 57 | } |
58 | pci_dev_put(pdev); | ||
57 | switch (index) { | 59 | switch (index) { |
58 | case 0: return 0x1f0; | 60 | case 0: return 0x1f0; |
59 | case 1: return 0x170; | 61 | case 1: return 0x170; |