diff options
Diffstat (limited to 'drivers/ata/pata_isapnp.c')
-rw-r--r-- | drivers/ata/pata_isapnp.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c index 1a61cc891741..d042efdfbac4 100644 --- a/drivers/ata/pata_isapnp.c +++ b/drivers/ata/pata_isapnp.c | |||
@@ -49,13 +49,13 @@ static struct ata_port_operations isapnp_port_ops = { | |||
49 | .thaw = ata_bmdma_thaw, | 49 | .thaw = ata_bmdma_thaw, |
50 | .error_handler = ata_bmdma_error_handler, | 50 | .error_handler = ata_bmdma_error_handler, |
51 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 51 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
52 | .cable_detect = ata_cable_40wire, | ||
52 | 53 | ||
53 | .qc_prep = ata_qc_prep, | 54 | .qc_prep = ata_qc_prep, |
54 | .qc_issue = ata_qc_issue_prot, | 55 | .qc_issue = ata_qc_issue_prot, |
55 | 56 | ||
56 | .data_xfer = ata_data_xfer, | 57 | .data_xfer = ata_data_xfer, |
57 | 58 | ||
58 | .irq_handler = ata_interrupt, | ||
59 | .irq_clear = ata_bmdma_irq_clear, | 59 | .irq_clear = ata_bmdma_irq_clear, |
60 | .irq_on = ata_irq_on, | 60 | .irq_on = ata_irq_on, |
61 | .irq_ack = ata_irq_ack, | 61 | .irq_ack = ata_irq_ack, |
@@ -74,8 +74,10 @@ static struct ata_port_operations isapnp_port_ops = { | |||
74 | 74 | ||
75 | static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev_id) | 75 | static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev_id) |
76 | { | 76 | { |
77 | struct ata_probe_ent ae; | 77 | struct ata_host *host; |
78 | struct ata_port *ap; | ||
78 | void __iomem *cmd_addr, *ctl_addr; | 79 | void __iomem *cmd_addr, *ctl_addr; |
80 | int rc; | ||
79 | 81 | ||
80 | if (pnp_port_valid(idev, 0) == 0) | 82 | if (pnp_port_valid(idev, 0) == 0) |
81 | return -ENODEV; | 83 | return -ENODEV; |
@@ -84,34 +86,36 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev | |||
84 | if (pnp_irq_valid(idev, 0) == 0) | 86 | if (pnp_irq_valid(idev, 0) == 0) |
85 | return -ENODEV; | 87 | return -ENODEV; |
86 | 88 | ||
89 | /* allocate host */ | ||
90 | host = ata_host_alloc(&idev->dev, 1); | ||
91 | if (!host) | ||
92 | return -ENOMEM; | ||
93 | |||
94 | /* acquire resources and fill host */ | ||
87 | cmd_addr = devm_ioport_map(&idev->dev, pnp_port_start(idev, 0), 8); | 95 | cmd_addr = devm_ioport_map(&idev->dev, pnp_port_start(idev, 0), 8); |
88 | if (!cmd_addr) | 96 | if (!cmd_addr) |
89 | return -ENOMEM; | 97 | return -ENOMEM; |
90 | 98 | ||
91 | memset(&ae, 0, sizeof(struct ata_probe_ent)); | 99 | ap = host->ports[0]; |
92 | INIT_LIST_HEAD(&ae.node); | 100 | |
93 | ae.dev = &idev->dev; | 101 | ap->ops = &isapnp_port_ops; |
94 | ae.port_ops = &isapnp_port_ops; | 102 | ap->pio_mask = 1; |
95 | ae.sht = &isapnp_sht; | 103 | ap->flags |= ATA_FLAG_SLAVE_POSS; |
96 | ae.n_ports = 1; | 104 | |
97 | ae.pio_mask = 1; /* ISA so PIO 0 cycles */ | 105 | ap->ioaddr.cmd_addr = cmd_addr; |
98 | ae.irq = pnp_irq(idev, 0); | ||
99 | ae.irq_flags = 0; | ||
100 | ae.port_flags = ATA_FLAG_SLAVE_POSS; | ||
101 | ae.port[0].cmd_addr = cmd_addr; | ||
102 | 106 | ||
103 | if (pnp_port_valid(idev, 1) == 0) { | 107 | if (pnp_port_valid(idev, 1) == 0) { |
104 | ctl_addr = devm_ioport_map(&idev->dev, | 108 | ctl_addr = devm_ioport_map(&idev->dev, |
105 | pnp_port_start(idev, 1), 1); | 109 | pnp_port_start(idev, 1), 1); |
106 | ae.port[0].altstatus_addr = ctl_addr; | 110 | ap->ioaddr.altstatus_addr = ctl_addr; |
107 | ae.port[0].ctl_addr = ctl_addr; | 111 | ap->ioaddr.ctl_addr = ctl_addr; |
108 | ae.port_flags |= ATA_FLAG_SRST; | ||
109 | } | 112 | } |
110 | ata_std_ports(&ae.port[0]); | ||
111 | 113 | ||
112 | if (ata_device_add(&ae) == 0) | 114 | ata_std_ports(&ap->ioaddr); |
113 | return -ENODEV; | 115 | |
114 | return 0; | 116 | /* activate */ |
117 | return ata_host_activate(host, pnp_irq(idev, 0), ata_interrupt, 0, | ||
118 | &isapnp_sht); | ||
115 | } | 119 | } |
116 | 120 | ||
117 | /** | 121 | /** |