aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_serverworks.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-03-09 07:24:15 -0500
committerJeff Garzik <jeff@garzik.org>2007-04-28 14:15:56 -0400
commita0fcdc0259e98d1c16d96baea9ba8a8603e41791 (patch)
tree568c6a99b5e38486c84b5145ac2e3719b8c62720 /drivers/ata/pata_serverworks.c
parent6a3d586d8e8a50e4cfd7f8c36d82a53c5614e05b (diff)
[libata] Update several PATA drivers for new ->cable_detect hook
All patches authored and signed-off-by Alan Cox, sent on Mar 7, 2007. I merely combined them all into a single patch. Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_serverworks.c')
-rw-r--r--drivers/ata/pata_serverworks.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 598eef810a74..283e9afade01 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * ata-serverworks.c - Serverworks PATA for new ATA layer 2 * pata_serverworks.c - Serverworks PATA for new ATA layer
3 * (C) 2005 Red Hat Inc 3 * (C) 2005 Red Hat Inc
4 * Alan Cox <alan@redhat.com> 4 * Alan Cox <alan@redhat.com>
5 * 5 *
@@ -137,14 +137,14 @@ static struct sv_cable_table cable_detect[] = {
137}; 137};
138 138
139/** 139/**
140 * serverworks_pre_reset - cable detection 140 * serverworks_cable_detect - cable detection
141 * @ap: ATA port 141 * @ap: ATA port
142 * 142 *
143 * Perform cable detection according to the device and subvendor 143 * Perform cable detection according to the device and subvendor
144 * identifications 144 * identifications
145 */ 145 */
146 146
147static int serverworks_pre_reset(struct ata_port *ap) { 147static int serverworks_cable_detect(struct ata_port *ap) {
148 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 148 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
149 struct sv_cable_table *cb = cable_detect; 149 struct sv_cable_table *cb = cable_detect;
150 150
@@ -152,8 +152,7 @@ static int serverworks_pre_reset(struct ata_port *ap) {
152 if (cb->device == pdev->device && 152 if (cb->device == pdev->device &&
153 (cb->subvendor == pdev->subsystem_vendor || 153 (cb->subvendor == pdev->subsystem_vendor ||
154 cb->subvendor == PCI_ANY_ID)) { 154 cb->subvendor == PCI_ANY_ID)) {
155 ap->cbl = cb->cable_detect(ap); 155 return cb->cable_detect(ap);
156 return ata_std_prereset(ap);
157 } 156 }
158 cb++; 157 cb++;
159 } 158 }
@@ -162,11 +161,6 @@ static int serverworks_pre_reset(struct ata_port *ap) {
162 return -1; /* kill compiler warning */ 161 return -1; /* kill compiler warning */
163} 162}
164 163
165static void serverworks_error_handler(struct ata_port *ap)
166{
167 return ata_bmdma_drive_eh(ap, serverworks_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
168}
169
170/** 164/**
171 * serverworks_is_csb - Check for CSB or OSB 165 * serverworks_is_csb - Check for CSB or OSB
172 * @pdev: PCI device to check 166 * @pdev: PCI device to check
@@ -339,8 +333,9 @@ static struct ata_port_operations serverworks_osb4_port_ops = {
339 333
340 .freeze = ata_bmdma_freeze, 334 .freeze = ata_bmdma_freeze,
341 .thaw = ata_bmdma_thaw, 335 .thaw = ata_bmdma_thaw,
342 .error_handler = serverworks_error_handler, 336 .error_handler = ata_bmdma_error_handler,
343 .post_internal_cmd = ata_bmdma_post_internal_cmd, 337 .post_internal_cmd = ata_bmdma_post_internal_cmd,
338 .cable_detect = serverworks_cable_detect,
344 339
345 .bmdma_setup = ata_bmdma_setup, 340 .bmdma_setup = ata_bmdma_setup,
346 .bmdma_start = ata_bmdma_start, 341 .bmdma_start = ata_bmdma_start,
@@ -374,8 +369,9 @@ static struct ata_port_operations serverworks_csb_port_ops = {
374 369
375 .freeze = ata_bmdma_freeze, 370 .freeze = ata_bmdma_freeze,
376 .thaw = ata_bmdma_thaw, 371 .thaw = ata_bmdma_thaw,
377 .error_handler = serverworks_error_handler, 372 .error_handler = ata_bmdma_error_handler,
378 .post_internal_cmd = ata_bmdma_post_internal_cmd, 373 .post_internal_cmd = ata_bmdma_post_internal_cmd,
374 .cable_detect = serverworks_cable_detect,
379 375
380 .bmdma_setup = ata_bmdma_setup, 376 .bmdma_setup = ata_bmdma_setup,
381 .bmdma_start = ata_bmdma_start, 377 .bmdma_start = ata_bmdma_start,