aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_artop.c
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/pata_artop.c
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/pata_artop.c')
-rw-r--r--drivers/ata/pata_artop.c18
1 files changed, 7 insertions, 11 deletions
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;