diff options
Diffstat (limited to 'drivers/ata/pata_legacy.c')
| -rw-r--r-- | drivers/ata/pata_legacy.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 86fbcd6a742b..707099291e01 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
| @@ -162,6 +162,7 @@ static struct ata_port_operations simple_port_ops = { | |||
| 162 | .thaw = ata_bmdma_thaw, | 162 | .thaw = ata_bmdma_thaw, |
| 163 | .error_handler = ata_bmdma_error_handler, | 163 | .error_handler = ata_bmdma_error_handler, |
| 164 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 164 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
| 165 | .cable_detect = ata_cable_40wire, | ||
| 165 | 166 | ||
| 166 | .qc_prep = ata_qc_prep, | 167 | .qc_prep = ata_qc_prep, |
| 167 | .qc_issue = ata_qc_issue_prot, | 168 | .qc_issue = ata_qc_issue_prot, |
| @@ -185,6 +186,7 @@ static struct ata_port_operations legacy_port_ops = { | |||
| 185 | .check_status = ata_check_status, | 186 | .check_status = ata_check_status, |
| 186 | .exec_command = ata_exec_command, | 187 | .exec_command = ata_exec_command, |
| 187 | .dev_select = ata_std_dev_select, | 188 | .dev_select = ata_std_dev_select, |
| 189 | .cable_detect = ata_cable_40wire, | ||
| 188 | 190 | ||
| 189 | .freeze = ata_bmdma_freeze, | 191 | .freeze = ata_bmdma_freeze, |
| 190 | .thaw = ata_bmdma_thaw, | 192 | .thaw = ata_bmdma_thaw, |
| @@ -305,6 +307,7 @@ static struct ata_port_operations pdc20230_port_ops = { | |||
| 305 | .thaw = ata_bmdma_thaw, | 307 | .thaw = ata_bmdma_thaw, |
| 306 | .error_handler = ata_bmdma_error_handler, | 308 | .error_handler = ata_bmdma_error_handler, |
| 307 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 309 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
| 310 | .cable_detect = ata_cable_40wire, | ||
| 308 | 311 | ||
| 309 | .qc_prep = ata_qc_prep, | 312 | .qc_prep = ata_qc_prep, |
| 310 | .qc_issue = ata_qc_issue_prot, | 313 | .qc_issue = ata_qc_issue_prot, |
| @@ -360,6 +363,7 @@ static struct ata_port_operations ht6560a_port_ops = { | |||
| 360 | .thaw = ata_bmdma_thaw, | 363 | .thaw = ata_bmdma_thaw, |
| 361 | .error_handler = ata_bmdma_error_handler, | 364 | .error_handler = ata_bmdma_error_handler, |
| 362 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 365 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
| 366 | .cable_detect = ata_cable_40wire, | ||
| 363 | 367 | ||
| 364 | .qc_prep = ata_qc_prep, | 368 | .qc_prep = ata_qc_prep, |
| 365 | .qc_issue = ata_qc_issue_prot, | 369 | .qc_issue = ata_qc_issue_prot, |
| @@ -426,6 +430,7 @@ static struct ata_port_operations ht6560b_port_ops = { | |||
| 426 | .thaw = ata_bmdma_thaw, | 430 | .thaw = ata_bmdma_thaw, |
| 427 | .error_handler = ata_bmdma_error_handler, | 431 | .error_handler = ata_bmdma_error_handler, |
| 428 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 432 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
| 433 | .cable_detect = ata_cable_40wire, | ||
| 429 | 434 | ||
| 430 | .qc_prep = ata_qc_prep, | 435 | .qc_prep = ata_qc_prep, |
| 431 | .qc_issue = ata_qc_issue_prot, | 436 | .qc_issue = ata_qc_issue_prot, |
| @@ -547,6 +552,7 @@ static struct ata_port_operations opti82c611a_port_ops = { | |||
| 547 | .thaw = ata_bmdma_thaw, | 552 | .thaw = ata_bmdma_thaw, |
| 548 | .error_handler = ata_bmdma_error_handler, | 553 | .error_handler = ata_bmdma_error_handler, |
| 549 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 554 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
| 555 | .cable_detect = ata_cable_40wire, | ||
| 550 | 556 | ||
| 551 | .qc_prep = ata_qc_prep, | 557 | .qc_prep = ata_qc_prep, |
| 552 | .qc_issue = ata_qc_issue_prot, | 558 | .qc_issue = ata_qc_issue_prot, |
| @@ -680,6 +686,7 @@ static struct ata_port_operations opti82c46x_port_ops = { | |||
| 680 | .thaw = ata_bmdma_thaw, | 686 | .thaw = ata_bmdma_thaw, |
| 681 | .error_handler = ata_bmdma_error_handler, | 687 | .error_handler = ata_bmdma_error_handler, |
| 682 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 688 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
| 689 | .cable_detect = ata_cable_40wire, | ||
| 683 | 690 | ||
| 684 | .qc_prep = ata_qc_prep, | 691 | .qc_prep = ata_qc_prep, |
| 685 | .qc_issue = opti82c46x_qc_issue_prot, | 692 | .qc_issue = opti82c46x_qc_issue_prot, |
| @@ -709,7 +716,8 @@ static struct ata_port_operations opti82c46x_port_ops = { | |||
| 709 | static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl, int irq) | 716 | static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl, int irq) |
| 710 | { | 717 | { |
| 711 | struct legacy_data *ld = &legacy_data[nr_legacy_host]; | 718 | struct legacy_data *ld = &legacy_data[nr_legacy_host]; |
| 712 | struct ata_probe_ent ae; | 719 | struct ata_host *host; |
| 720 | struct ata_port *ap; | ||
| 713 | struct platform_device *pdev; | 721 | struct platform_device *pdev; |
| 714 | struct ata_port_operations *ops = &legacy_port_ops; | 722 | struct ata_port_operations *ops = &legacy_port_ops; |
| 715 | void __iomem *io_addr, *ctrl_addr; | 723 | void __iomem *io_addr, *ctrl_addr; |
| @@ -791,24 +799,23 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl | |||
| 791 | if (ops == &legacy_port_ops && (autospeed & mask)) | 799 | if (ops == &legacy_port_ops && (autospeed & mask)) |
| 792 | ops = &simple_port_ops; | 800 | ops = &simple_port_ops; |
| 793 | 801 | ||
| 794 | memset(&ae, 0, sizeof(struct ata_probe_ent)); | 802 | ret = -ENOMEM; |
| 795 | INIT_LIST_HEAD(&ae.node); | 803 | host = ata_host_alloc(&pdev->dev, 1); |
| 796 | ae.dev = &pdev->dev; | 804 | if (!host) |
| 797 | ae.port_ops = ops; | 805 | goto fail; |
| 798 | ae.sht = &legacy_sht; | 806 | ap = host->ports[0]; |
| 799 | ae.n_ports = 1; | 807 | |
| 800 | ae.pio_mask = pio_modes; | 808 | ap->ops = ops; |
| 801 | ae.irq = irq; | 809 | ap->pio_mask = pio_modes; |
| 802 | ae.irq_flags = 0; | 810 | ap->flags |= ATA_FLAG_SLAVE_POSS | iordy; |
| 803 | ae.port_flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST|iordy; | 811 | ap->ioaddr.cmd_addr = io_addr; |
| 804 | ae.port[0].cmd_addr = io_addr; | 812 | ap->ioaddr.altstatus_addr = ctrl_addr; |
| 805 | ae.port[0].altstatus_addr = ctrl_addr; | 813 | ap->ioaddr.ctl_addr = ctrl_addr; |
| 806 | ae.port[0].ctl_addr = ctrl_addr; | 814 | ata_std_ports(&ap->ioaddr); |
| 807 | ata_std_ports(&ae.port[0]); | 815 | ap->private_data = ld; |
| 808 | ae.private_data = ld; | 816 | |
| 809 | 817 | ret = ata_host_activate(host, irq, ata_interrupt, 0, &legacy_sht); | |
| 810 | ret = -ENODEV; | 818 | if (ret) |
| 811 | if (!ata_device_add(&ae)) | ||
| 812 | goto fail; | 819 | goto fail; |
| 813 | 820 | ||
| 814 | legacy_host[nr_legacy_host++] = dev_get_drvdata(&pdev->dev); | 821 | legacy_host[nr_legacy_host++] = dev_get_drvdata(&pdev->dev); |
