aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-09-26 12:53:38 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-26 13:34:27 -0400
commitc961922b73dab429a759f560952fd4c3f60bd6b3 (patch)
treecbd6d6424d508fd208ae9992c1cf11b3b8a91fb1 /drivers/ata
parent4735ebedf37731160e3d3efc9fc9d4939c66fefa (diff)
[PATCH] libata-eh: Remove layering violation and duplication when handling absent ports
This removes the layering violation where drivers have to fiddle directly with EH flags. Instead we now recognize -ENOENT means "no port" and do the handling in the core code. This also removes an instance of a call to disable the port, and an identical printk from each driver doing this. Even better - future rule changes will be in one place only. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ata_piix.c8
-rw-r--r--drivers/ata/libata-eh.c6
-rw-r--r--drivers/ata/pata_amd.c25
-rw-r--r--drivers/ata/pata_artop.c18
-rw-r--r--drivers/ata/pata_atiixp.c10
-rw-r--r--drivers/ata/pata_efar.c10
-rw-r--r--drivers/ata/pata_jmicron.c2
-rw-r--r--drivers/ata/pata_mpiix.c11
-rw-r--r--drivers/ata/pata_ns87410.c7
-rw-r--r--drivers/ata/pata_oldpiix.c9
-rw-r--r--drivers/ata/pata_opti.c10
-rw-r--r--drivers/ata/pata_optidma.c10
-rw-r--r--drivers/ata/pata_pdc2027x.c8
-rw-r--r--drivers/ata/pata_sis.c10
-rw-r--r--drivers/ata/pata_sl82c105.c9
-rw-r--r--drivers/ata/pata_triflex.c13
-rw-r--r--drivers/ata/pata_via.c9
17 files changed, 67 insertions, 108 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index ffa111eea9da..5719704eb0ee 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -643,11 +643,9 @@ static int piix_pata_prereset(struct ata_port *ap)
643{ 643{
644 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 644 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
645 645
646 if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no])) { 646 if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
647 ata_port_printk(ap, KERN_INFO, "port disabled. ignoring.\n"); 647 return -ENOENT;
648 ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; 648
649 return 0;
650 }
651 ap->cbl = ATA_CBL_PATA40; 649 ap->cbl = ATA_CBL_PATA40;
652 return ata_std_prereset(ap); 650 return ata_std_prereset(ap);
653} 651}
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 3fa80f09f2ae..02b2b2787d9b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1515,7 +1515,11 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1515 if (prereset) { 1515 if (prereset) {
1516 rc = prereset(ap); 1516 rc = prereset(ap);
1517 if (rc) { 1517 if (rc) {
1518 ata_port_printk(ap, KERN_ERR, 1518 if (rc == -ENOENT) {
1519 ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n");
1520 ap->eh_context.i.action &= ~ATA_EH_RESET_MASK;
1521 } else
1522 ata_port_printk(ap, KERN_ERR,
1519 "prereset failed (errno=%d)\n", rc); 1523 "prereset failed (errno=%d)\n", rc);
1520 return rc; 1524 return rc;
1521 } 1525 }
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 3293cf9a7eb5..793a5e1cb4cb 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_amd" 27#define DRV_NAME "pata_amd"
28#define DRV_VERSION "0.2.3" 28#define DRV_VERSION "0.2.4"
29 29
30/** 30/**
31 * timing_setup - shared timing computation and load 31 * timing_setup - shared timing computation and load
@@ -137,11 +137,8 @@ static int amd_pre_reset(struct ata_port *ap)
137 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 137 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
138 u8 ata66; 138 u8 ata66;
139 139
140 if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no])) { 140 if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no]))
141 ata_port_disable(ap); 141 return -ENOENT;
142 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
143 return 0;
144 }
145 142
146 pci_read_config_byte(pdev, 0x42, &ata66); 143 pci_read_config_byte(pdev, 0x42, &ata66);
147 if (ata66 & bitmask[ap->port_no]) 144 if (ata66 & bitmask[ap->port_no])
@@ -167,11 +164,9 @@ static int amd_early_pre_reset(struct ata_port *ap)
167 { 0x40, 1, 0x01, 0x01 } 164 { 0x40, 1, 0x01, 0x01 }
168 }; 165 };
169 166
170 if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no])) { 167 if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no]))
171 ata_port_disable(ap); 168 return -ENOENT;
172 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 169
173 return 0;
174 }
175 /* No host side cable detection */ 170 /* No host side cable detection */
176 ap->cbl = ATA_CBL_PATA80; 171 ap->cbl = ATA_CBL_PATA80;
177 return ata_std_prereset(ap); 172 return ata_std_prereset(ap);
@@ -262,12 +257,8 @@ static int nv_pre_reset(struct ata_port *ap) {
262 u8 ata66; 257 u8 ata66;
263 u16 udma; 258 u16 udma;
264 259
265 if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no])) { 260 if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no]))
266 ata_port_disable(ap); 261 return -ENOENT;
267 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
268 return 0;
269 }
270
271 262
272 pci_read_config_byte(pdev, 0x52, &ata66); 263 pci_read_config_byte(pdev, 0x52, &ata66);
273 if (ata66 & bitmask[ap->port_no]) 264 if (ata66 & bitmask[ap->port_no])
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index d6ef3bf1bac7..0f3b49176dc1 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -28,7 +28,7 @@
28#include <linux/ata.h> 28#include <linux/ata.h>
29 29
30#define DRV_NAME "pata_artop" 30#define DRV_NAME "pata_artop"
31#define DRV_VERSION "0.4.1" 31#define DRV_VERSION "0.4.2"
32 32
33/* 33/*
34 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we 34 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we
@@ -47,11 +47,9 @@ static int artop6210_pre_reset(struct ata_port *ap)
47 { 0x4AU, 1U, 0x04UL, 0x04UL }, /* port 1 */ 47 { 0x4AU, 1U, 0x04UL, 0x04UL }, /* port 1 */
48 }; 48 };
49 49
50 if (!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) { 50 if (!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
51 ata_port_disable(ap); 51 return -ENOENT;
52 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 52
53 return 0;
54 }
55 ap->cbl = ATA_CBL_PATA40; 53 ap->cbl = ATA_CBL_PATA40;
56 return ata_std_prereset(ap); 54 return ata_std_prereset(ap);
57} 55}
@@ -90,11 +88,9 @@ static int artop6260_pre_reset(struct ata_port *ap)
90 u8 tmp; 88 u8 tmp;
91 89
92 /* Odd numbered device ids are the units with enable bits (the -R cards) */ 90 /* Odd numbered device ids are the units with enable bits (the -R cards) */
93 if (pdev->device % 1 && !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) { 91 if (pdev->device % 1 && !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
94 ata_port_disable(ap); 92 return -ENOENT;
95 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 93
96 return 0;
97 }
98 pci_read_config_byte(pdev, 0x49, &tmp); 94 pci_read_config_byte(pdev, 0x49, &tmp);
99 if (tmp & (1 >> ap->port_no)) 95 if (tmp & (1 >> ap->port_no))
100 ap->cbl = ATA_CBL_PATA40; 96 ap->cbl = ATA_CBL_PATA40;
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 3f78a1e54a75..060d019fd30b 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -22,7 +22,7 @@
22#include <linux/libata.h> 22#include <linux/libata.h>
23 23
24#define DRV_NAME "pata_atiixp" 24#define DRV_NAME "pata_atiixp"
25#define DRV_VERSION "0.4.2" 25#define DRV_VERSION "0.4.3"
26 26
27enum { 27enum {
28 ATIIXP_IDE_PIO_TIMING = 0x40, 28 ATIIXP_IDE_PIO_TIMING = 0x40,
@@ -41,11 +41,9 @@ static int atiixp_pre_reset(struct ata_port *ap)
41 { 0x48, 1, 0x08, 0x00 } 41 { 0x48, 1, 0x08, 0x00 }
42 }; 42 };
43 43
44 if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) { 44 if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
45 ata_port_disable(ap); 45 return -ENOENT;
46 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 46
47 return 0;
48 }
49 ap->cbl = ATA_CBL_PATA80; 47 ap->cbl = ATA_CBL_PATA80;
50 return ata_std_prereset(ap); 48 return ata_std_prereset(ap);
51} 49}
diff --git a/drivers/ata/pata_efar.c b/drivers/ata/pata_efar.c
index c30bc181304f..92813827faa7 100644
--- a/drivers/ata/pata_efar.c
+++ b/drivers/ata/pata_efar.c
@@ -22,7 +22,7 @@
22#include <linux/ata.h> 22#include <linux/ata.h>
23 23
24#define DRV_NAME "pata_efar" 24#define DRV_NAME "pata_efar"
25#define DRV_VERSION "0.4.1" 25#define DRV_VERSION "0.4.2"
26 26
27/** 27/**
28 * efar_pre_reset - check for 40/80 pin 28 * efar_pre_reset - check for 40/80 pin
@@ -42,11 +42,9 @@ static int efar_pre_reset(struct ata_port *ap)
42 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 42 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
43 u8 tmp; 43 u8 tmp;
44 44
45 if (!pci_test_config_bits(pdev, &efar_enable_bits[ap->port_no])) { 45 if (!pci_test_config_bits(pdev, &efar_enable_bits[ap->port_no]))
46 ata_port_disable(ap); 46 return -ENOENT;
47 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 47
48 return 0;
49 }
50 pci_read_config_byte(pdev, 0x47, &tmp); 48 pci_read_config_byte(pdev, 0x47, &tmp);
51 if (tmp & (2 >> ap->port_no)) 49 if (tmp & (2 >> ap->port_no))
52 ap->cbl = ATA_CBL_PATA40; 50 ap->cbl = ATA_CBL_PATA40;
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index 6832a643a9eb..3bdb6f2fa5ba 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -51,7 +51,7 @@ static int jmicron_pre_reset(struct ata_port *ap)
51 /* Check if our port is enabled */ 51 /* Check if our port is enabled */
52 pci_read_config_dword(pdev, 0x40, &control); 52 pci_read_config_dword(pdev, 0x40, &control);
53 if ((control & port_mask) == 0) 53 if ((control & port_mask) == 0)
54 return 0; 54 return -ENOENT;
55 55
56 /* There are two basic mappings. One has the two SATA ports merged 56 /* There are two basic mappings. One has the two SATA ports merged
57 as master/slave and the secondary as PATA, the other has only the 57 as master/slave and the secondary as PATA, the other has only the
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c
index 1958c4ed09a8..3c65393c1f01 100644
--- a/drivers/ata/pata_mpiix.c
+++ b/drivers/ata/pata_mpiix.c
@@ -18,7 +18,7 @@
18 * The driver conciously keeps this logic internally to avoid pushing quirky 18 * The driver conciously keeps this logic internally to avoid pushing quirky
19 * PATA history into the clean libata layer. 19 * PATA history into the clean libata layer.
20 * 20 *
21 * Thinkpad specific note: If you boot an MPIIX using thinkpad with a PCMCIA 21 * Thinkpad specific note: If you boot an MPIIX using a thinkpad with a PCMCIA
22 * hard disk present this driver will not detect it. This is not a bug. In this 22 * hard disk present this driver will not detect it. This is not a bug. In this
23 * configuration the secondary port of the MPIIX is disabled and the addresses 23 * configuration the secondary port of the MPIIX is disabled and the addresses
24 * are decoded by the PCMCIA bridge and therefore are for a generic IDE driver 24 * are decoded by the PCMCIA bridge and therefore are for a generic IDE driver
@@ -35,7 +35,7 @@
35#include <linux/libata.h> 35#include <linux/libata.h>
36 36
37#define DRV_NAME "pata_mpiix" 37#define DRV_NAME "pata_mpiix"
38#define DRV_VERSION "0.7.1" 38#define DRV_VERSION "0.7.2"
39 39
40enum { 40enum {
41 IDETIM = 0x6C, /* IDE control register */ 41 IDETIM = 0x6C, /* IDE control register */
@@ -54,11 +54,8 @@ static int mpiix_pre_reset(struct ata_port *ap)
54 { 0x6F, 1, 0x80, 0x80 } 54 { 0x6F, 1, 0x80, 0x80 }
55 }; 55 };
56 56
57 if (!pci_test_config_bits(pdev, &mpiix_enable_bits[ap->port_no])) { 57 if (!pci_test_config_bits(pdev, &mpiix_enable_bits[ap->port_no]))
58 ata_port_disable(ap); 58 return -ENOENT;
59 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
60 return 0;
61 }
62 ap->cbl = ATA_CBL_PATA40; 59 ap->cbl = ATA_CBL_PATA40;
63 return ata_std_prereset(ap); 60 return ata_std_prereset(ap);
64} 61}
diff --git a/drivers/ata/pata_ns87410.c b/drivers/ata/pata_ns87410.c
index 93d6646d2954..f529fe4c29b7 100644
--- a/drivers/ata/pata_ns87410.c
+++ b/drivers/ata/pata_ns87410.c
@@ -45,11 +45,8 @@ static int ns87410_pre_reset(struct ata_port *ap)
45 { 0x47, 1, 0x08, 0x08 } 45 { 0x47, 1, 0x08, 0x08 }
46 }; 46 };
47 47
48 if (!pci_test_config_bits(pdev, &ns87410_enable_bits[ap->port_no])) { 48 if (!pci_test_config_bits(pdev, &ns87410_enable_bits[ap->port_no]))
49 ata_port_disable(ap); 49 return -ENOENT;
50 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
51 return 0;
52 }
53 ap->cbl = ATA_CBL_PATA40; 50 ap->cbl = ATA_CBL_PATA40;
54 return ata_std_prereset(ap); 51 return ata_std_prereset(ap);
55} 52}
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c
index 04c618a2664b..31a285ca88dc 100644
--- a/drivers/ata/pata_oldpiix.c
+++ b/drivers/ata/pata_oldpiix.c
@@ -25,7 +25,7 @@
25#include <linux/ata.h> 25#include <linux/ata.h>
26 26
27#define DRV_NAME "pata_oldpiix" 27#define DRV_NAME "pata_oldpiix"
28#define DRV_VERSION "0.5.1" 28#define DRV_VERSION "0.5.2"
29 29
30/** 30/**
31 * oldpiix_pre_reset - probe begin 31 * oldpiix_pre_reset - probe begin
@@ -42,11 +42,8 @@ static int oldpiix_pre_reset(struct ata_port *ap)
42 { 0x43U, 1U, 0x80UL, 0x80UL }, /* port 1 */ 42 { 0x43U, 1U, 0x80UL, 0x80UL }, /* port 1 */
43 }; 43 };
44 44
45 if (!pci_test_config_bits(pdev, &oldpiix_enable_bits[ap->port_no])) { 45 if (!pci_test_config_bits(pdev, &oldpiix_enable_bits[ap->port_no]))
46 ata_port_disable(ap); 46 return -ENOENT;
47 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
48 return 0;
49 }
50 ap->cbl = ATA_CBL_PATA40; 47 ap->cbl = ATA_CBL_PATA40;
51 return ata_std_prereset(ap); 48 return ata_std_prereset(ap);
52} 49}
diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c
index c3d01325e0e2..136d7a65feb3 100644
--- a/drivers/ata/pata_opti.c
+++ b/drivers/ata/pata_opti.c
@@ -34,7 +34,7 @@
34#include <linux/libata.h> 34#include <linux/libata.h>
35 35
36#define DRV_NAME "pata_opti" 36#define DRV_NAME "pata_opti"
37#define DRV_VERSION "0.2.4" 37#define DRV_VERSION "0.2.5"
38 38
39enum { 39enum {
40 READ_REG = 0, /* index of Read cycle timing register */ 40 READ_REG = 0, /* index of Read cycle timing register */
@@ -59,11 +59,9 @@ static int opti_pre_reset(struct ata_port *ap)
59 { 0x40, 1, 0x08, 0x00 } 59 { 0x40, 1, 0x08, 0x00 }
60 }; 60 };
61 61
62 if (!pci_test_config_bits(pdev, &opti_enable_bits[ap->port_no])) { 62 if (!pci_test_config_bits(pdev, &opti_enable_bits[ap->port_no]))
63 ata_port_disable(ap); 63 return -ENOENT;
64 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 64
65 return 0;
66 }
67 ap->cbl = ATA_CBL_PATA40; 65 ap->cbl = ATA_CBL_PATA40;
68 return ata_std_prereset(ap); 66 return ata_std_prereset(ap);
69} 67}
diff --git a/drivers/ata/pata_optidma.c b/drivers/ata/pata_optidma.c
index 177a455f4251..18ec8e72bbb6 100644
--- a/drivers/ata/pata_optidma.c
+++ b/drivers/ata/pata_optidma.c
@@ -33,7 +33,7 @@
33#include <linux/libata.h> 33#include <linux/libata.h>
34 34
35#define DRV_NAME "pata_optidma" 35#define DRV_NAME "pata_optidma"
36#define DRV_VERSION "0.2.1" 36#define DRV_VERSION "0.2.2"
37 37
38enum { 38enum {
39 READ_REG = 0, /* index of Read cycle timing register */ 39 READ_REG = 0, /* index of Read cycle timing register */
@@ -59,11 +59,9 @@ static int optidma_pre_reset(struct ata_port *ap)
59 0x40, 1, 0x08, 0x00 59 0x40, 1, 0x08, 0x00
60 }; 60 };
61 61
62 if (ap->port_no && !pci_test_config_bits(pdev, &optidma_enable_bits)) { 62 if (ap->port_no && !pci_test_config_bits(pdev, &optidma_enable_bits))
63 ata_port_disable(ap); 63 return -ENOENT;
64 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 64
65 return 0;
66 }
67 ap->cbl = ATA_CBL_PATA40; 65 ap->cbl = ATA_CBL_PATA40;
68 return ata_std_prereset(ap); 66 return ata_std_prereset(ap);
69} 67}
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 31ab9c886209..bd4ed6734edc 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -36,7 +36,7 @@
36#include <asm/io.h> 36#include <asm/io.h>
37 37
38#define DRV_NAME "pata_pdc2027x" 38#define DRV_NAME "pata_pdc2027x"
39#define DRV_VERSION "0.74-ac3" 39#define DRV_VERSION "0.74-ac5"
40#undef PDC_DEBUG 40#undef PDC_DEBUG
41 41
42#ifdef PDC_DEBUG 42#ifdef PDC_DEBUG
@@ -311,10 +311,8 @@ static inline int pdc2027x_port_enabled(struct ata_port *ap)
311static int pdc2027x_prereset(struct ata_port *ap) 311static int pdc2027x_prereset(struct ata_port *ap)
312{ 312{
313 /* Check whether port enabled */ 313 /* Check whether port enabled */
314 if (!pdc2027x_port_enabled(ap)) { 314 if (!pdc2027x_port_enabled(ap))
315 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 315 return -ENOENT;
316 return 0;
317 }
318 pdc2027x_cbl_detect(ap); 316 pdc2027x_cbl_detect(ap);
319 return ata_std_prereset(ap); 317 return ata_std_prereset(ap);
320} 318}
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 2e555168b431..fce74d9b2e67 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -34,7 +34,7 @@
34#include <linux/ata.h> 34#include <linux/ata.h>
35 35
36#define DRV_NAME "pata_sis" 36#define DRV_NAME "pata_sis"
37#define DRV_VERSION "0.4.3" 37#define DRV_VERSION "0.4.4"
38 38
39struct sis_chipset { 39struct sis_chipset {
40 u16 device; /* PCI host ID */ 40 u16 device; /* PCI host ID */
@@ -74,11 +74,9 @@ static int sis_133_pre_reset(struct ata_port *ap)
74 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 74 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
75 u16 tmp; 75 u16 tmp;
76 76
77 if (!pci_test_config_bits(pdev, &sis_enable_bits[ap->port_no])) { 77 if (!pci_test_config_bits(pdev, &sis_enable_bits[ap->port_no]))
78 ata_port_disable(ap); 78 return -ENOENT;
79 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 79
80 return 0;
81 }
82 /* The top bit of this register is the cable detect bit */ 80 /* The top bit of this register is the cable detect bit */
83 pci_read_config_word(pdev, 0x50 + 2 * ap->port_no, &tmp); 81 pci_read_config_word(pdev, 0x50 + 2 * ap->port_no, &tmp);
84 if (tmp & 0x8000) 82 if (tmp & 0x8000)
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c
index f8499786917a..b3bc607f0293 100644
--- a/drivers/ata/pata_sl82c105.c
+++ b/drivers/ata/pata_sl82c105.c
@@ -19,7 +19,7 @@
19#include <linux/libata.h> 19#include <linux/libata.h>
20 20
21#define DRV_NAME "pata_sl82c105" 21#define DRV_NAME "pata_sl82c105"
22#define DRV_VERSION "0.2.2" 22#define DRV_VERSION "0.2.3"
23 23
24enum { 24enum {
25 /* 25 /*
@@ -49,11 +49,8 @@ static int sl82c105_pre_reset(struct ata_port *ap)
49 }; 49 };
50 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 50 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
51 51
52 if (ap->port_no && !pci_test_config_bits(pdev, &sl82c105_enable_bits[ap->port_no])) { 52 if (ap->port_no && !pci_test_config_bits(pdev, &sl82c105_enable_bits[ap->port_no]))
53 ata_port_disable(ap); 53 return -ENOENT;
54 dev_printk(KERN_INFO, &pdev->dev, "port disabled. ignoring.\n");
55 return 0;
56 }
57 ap->cbl = ATA_CBL_PATA40; 54 ap->cbl = ATA_CBL_PATA40;
58 return ata_std_prereset(ap); 55 return ata_std_prereset(ap);
59} 56}
diff --git a/drivers/ata/pata_triflex.c b/drivers/ata/pata_triflex.c
index 36f788728f3f..95adf92901fc 100644
--- a/drivers/ata/pata_triflex.c
+++ b/drivers/ata/pata_triflex.c
@@ -46,13 +46,13 @@
46#define DRV_VERSION "0.2.5" 46#define DRV_VERSION "0.2.5"
47 47
48/** 48/**
49 * triflex_probe_init - probe begin 49 * triflex_prereset - probe begin
50 * @ap: ATA port 50 * @ap: ATA port
51 * 51 *
52 * Set up cable type and use generic probe init 52 * Set up cable type and use generic probe init
53 */ 53 */
54 54
55static int triflex_probe_init(struct ata_port *ap) 55static int triflex_prereset(struct ata_port *ap)
56{ 56{
57 static const struct pci_bits triflex_enable_bits[] = { 57 static const struct pci_bits triflex_enable_bits[] = {
58 { 0x80, 1, 0x01, 0x01 }, 58 { 0x80, 1, 0x01, 0x01 },
@@ -61,11 +61,8 @@ static int triflex_probe_init(struct ata_port *ap)
61 61
62 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 62 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
63 63
64 if (!pci_test_config_bits(pdev, &triflex_enable_bits[ap->port_no])) { 64 if (!pci_test_config_bits(pdev, &triflex_enable_bits[ap->port_no]))
65 ata_port_disable(ap); 65 return -ENOENT;
66 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
67 return 0;
68 }
69 ap->cbl = ATA_CBL_PATA40; 66 ap->cbl = ATA_CBL_PATA40;
70 return ata_std_prereset(ap); 67 return ata_std_prereset(ap);
71} 68}
@@ -74,7 +71,7 @@ static int triflex_probe_init(struct ata_port *ap)
74 71
75static void triflex_error_handler(struct ata_port *ap) 72static void triflex_error_handler(struct ata_port *ap)
76{ 73{
77 ata_bmdma_drive_eh(ap, triflex_probe_init, ata_std_softreset, NULL, ata_std_postreset); 74 ata_bmdma_drive_eh(ap, triflex_prereset, ata_std_softreset, NULL, ata_std_postreset);
78} 75}
79 76
80/** 77/**
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 1b2ff133b163..0e8b1303acd6 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -60,7 +60,7 @@
60#include <linux/libata.h> 60#include <linux/libata.h>
61 61
62#define DRV_NAME "pata_via" 62#define DRV_NAME "pata_via"
63#define DRV_VERSION "0.1.13" 63#define DRV_VERSION "0.1.14"
64 64
65/* 65/*
66 * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx 66 * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -155,11 +155,8 @@ static int via_pre_reset(struct ata_port *ap)
155 155
156 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 156 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
157 157
158 if (!pci_test_config_bits(pdev, &via_enable_bits[ap->port_no])) { 158 if (!pci_test_config_bits(pdev, &via_enable_bits[ap->port_no]))
159 ata_port_disable(ap); 159 return -ENOENT;
160 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
161 return 0;
162 }
163 } 160 }
164 161
165 if ((config->flags & VIA_UDMA) >= VIA_UDMA_66) 162 if ((config->flags & VIA_UDMA) >= VIA_UDMA_66)