aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_amd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_amd.c')
-rw-r--r--drivers/ata/pata_amd.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 644702cac6ee..09c8286b6890 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -144,12 +144,6 @@ static int amd_pre_reset(struct ata_link *link, unsigned long deadline)
144 return ata_std_prereset(link, deadline); 144 return ata_std_prereset(link, deadline);
145} 145}
146 146
147static void amd_error_handler(struct ata_port *ap)
148{
149 ata_bmdma_drive_eh(ap, amd_pre_reset, ata_std_softreset, NULL,
150 ata_std_postreset);
151}
152
153static int amd_cable_detect(struct ata_port *ap) 147static int amd_cable_detect(struct ata_port *ap)
154{ 148{
155 static const u32 bitmask[2] = {0x03, 0x0C}; 149 static const u32 bitmask[2] = {0x03, 0x0C};
@@ -300,13 +294,6 @@ static int nv_pre_reset(struct ata_link *link, unsigned long deadline)
300 return ata_std_prereset(link, deadline); 294 return ata_std_prereset(link, deadline);
301} 295}
302 296
303static void nv_error_handler(struct ata_port *ap)
304{
305 ata_bmdma_drive_eh(ap, nv_pre_reset,
306 ata_std_softreset, NULL,
307 ata_std_postreset);
308}
309
310/** 297/**
311 * nv100_set_piomode - set initial PIO mode data 298 * nv100_set_piomode - set initial PIO mode data
312 * @ap: ATA interface 299 * @ap: ATA interface
@@ -358,7 +345,7 @@ static struct scsi_host_template amd_sht = {
358 345
359static const struct ata_port_operations amd_base_port_ops = { 346static const struct ata_port_operations amd_base_port_ops = {
360 .inherits = &ata_bmdma_port_ops, 347 .inherits = &ata_bmdma_port_ops,
361 .error_handler = amd_error_handler, 348 .prereset = amd_pre_reset,
362}; 349};
363 350
364static struct ata_port_operations amd33_port_ops = { 351static struct ata_port_operations amd33_port_ops = {
@@ -393,7 +380,7 @@ static const struct ata_port_operations nv_base_port_ops = {
393 .inherits = &ata_bmdma_port_ops, 380 .inherits = &ata_bmdma_port_ops,
394 .cable_detect = ata_cable_ignore, 381 .cable_detect = ata_cable_ignore,
395 .mode_filter = nv_mode_filter, 382 .mode_filter = nv_mode_filter,
396 .error_handler = nv_error_handler, 383 .prereset = nv_pre_reset,
397 .host_stop = nv_host_stop, 384 .host_stop = nv_host_stop,
398}; 385};
399 386
@@ -483,10 +470,10 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
483 .port_ops = &amd100_port_ops 470 .port_ops = &amd100_port_ops
484 } 471 }
485 }; 472 };
486 struct ata_port_info pi; 473 const struct ata_port_info *ppi[] = { NULL, NULL };
487 const struct ata_port_info *ppi[] = { &pi, NULL };
488 static int printed_version; 474 static int printed_version;
489 int type = id->driver_data; 475 int type = id->driver_data;
476 void *hpriv = NULL;
490 u8 fifo; 477 u8 fifo;
491 int rc; 478 int rc;
492 479
@@ -511,7 +498,7 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
511 /* 498 /*
512 * Okay, type is determined now. Apply type-specific workarounds. 499 * Okay, type is determined now. Apply type-specific workarounds.
513 */ 500 */
514 pi = info[type]; 501 ppi[0] = &info[type];
515 502
516 if (type < 3) 503 if (type < 3)
517 ata_pci_clear_simplex(pdev); 504 ata_pci_clear_simplex(pdev);
@@ -530,11 +517,11 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
530 u32 udma; 517 u32 udma;
531 518
532 pci_read_config_dword(pdev, 0x60, &udma); 519 pci_read_config_dword(pdev, 0x60, &udma);
533 pi.private_data = (void *)(unsigned long)udma; 520 hpriv = (void *)(unsigned long)udma;
534 } 521 }
535 522
536 /* And fire it up */ 523 /* And fire it up */
537 return ata_pci_init_one(pdev, ppi, &amd_sht); 524 return ata_pci_init_one(pdev, ppi, &amd_sht, hpriv);
538} 525}
539 526
540#ifdef CONFIG_PM 527#ifdef CONFIG_PM