aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_qdi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_qdi.c')
-rw-r--r--drivers/ata/pata_qdi.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index c3810012f3f4..27685ce63ceb 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -183,13 +183,13 @@ static struct ata_port_operations qdi6500_port_ops = {
183 .thaw = ata_bmdma_thaw, 183 .thaw = ata_bmdma_thaw,
184 .error_handler = ata_bmdma_error_handler, 184 .error_handler = ata_bmdma_error_handler,
185 .post_internal_cmd = ata_bmdma_post_internal_cmd, 185 .post_internal_cmd = ata_bmdma_post_internal_cmd,
186 .cable_detect = ata_cable_40wire,
186 187
187 .qc_prep = ata_qc_prep, 188 .qc_prep = ata_qc_prep,
188 .qc_issue = qdi_qc_issue_prot, 189 .qc_issue = qdi_qc_issue_prot,
189 190
190 .data_xfer = qdi_data_xfer, 191 .data_xfer = qdi_data_xfer,
191 192
192 .irq_handler = ata_interrupt,
193 .irq_clear = ata_bmdma_irq_clear, 193 .irq_clear = ata_bmdma_irq_clear,
194 .irq_on = ata_irq_on, 194 .irq_on = ata_irq_on,
195 .irq_ack = ata_irq_ack, 195 .irq_ack = ata_irq_ack,
@@ -211,13 +211,13 @@ static struct ata_port_operations qdi6580_port_ops = {
211 .thaw = ata_bmdma_thaw, 211 .thaw = ata_bmdma_thaw,
212 .error_handler = ata_bmdma_error_handler, 212 .error_handler = ata_bmdma_error_handler,
213 .post_internal_cmd = ata_bmdma_post_internal_cmd, 213 .post_internal_cmd = ata_bmdma_post_internal_cmd,
214 .cable_detect = ata_cable_40wire,
214 215
215 .qc_prep = ata_qc_prep, 216 .qc_prep = ata_qc_prep,
216 .qc_issue = qdi_qc_issue_prot, 217 .qc_issue = qdi_qc_issue_prot,
217 218
218 .data_xfer = qdi_data_xfer, 219 .data_xfer = qdi_data_xfer,
219 220
220 .irq_handler = ata_interrupt,
221 .irq_clear = ata_bmdma_irq_clear, 221 .irq_clear = ata_bmdma_irq_clear,
222 .irq_on = ata_irq_on, 222 .irq_on = ata_irq_on,
223 .irq_ack = ata_irq_ack, 223 .irq_ack = ata_irq_ack,
@@ -238,8 +238,9 @@ static struct ata_port_operations qdi6580_port_ops = {
238 238
239static __init int qdi_init_one(unsigned long port, int type, unsigned long io, int irq, int fast) 239static __init int qdi_init_one(unsigned long port, int type, unsigned long io, int irq, int fast)
240{ 240{
241 struct ata_probe_ent ae;
242 struct platform_device *pdev; 241 struct platform_device *pdev;
242 struct ata_host *host;
243 struct ata_port *ap;
243 void __iomem *io_addr, *ctl_addr; 244 void __iomem *io_addr, *ctl_addr;
244 int ret; 245 int ret;
245 246
@@ -257,34 +258,31 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i
257 if (!io_addr || !ctl_addr) 258 if (!io_addr || !ctl_addr)
258 goto fail; 259 goto fail;
259 260
260 memset(&ae, 0, sizeof(struct ata_probe_ent)); 261 ret = -ENOMEM;
261 INIT_LIST_HEAD(&ae.node); 262 host = ata_host_alloc(&pdev->dev, 1);
262 ae.dev = &pdev->dev; 263 if (!host)
264 goto fail;
265 ap = host->ports[0];
263 266
264 if (type == 6580) { 267 if (type == 6580) {
265 ae.port_ops = &qdi6580_port_ops; 268 ap->ops = &qdi6580_port_ops;
266 ae.pio_mask = 0x1F; 269 ap->pio_mask = 0x1F;
267 ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; 270 ap->flags |= ATA_FLAG_SLAVE_POSS;
268 } else { 271 } else {
269 ae.port_ops = &qdi6500_port_ops; 272 ap->ops = &qdi6500_port_ops;
270 ae.pio_mask = 0x07; /* Actually PIO3 !IORDY is possible */ 273 ap->pio_mask = 0x07; /* Actually PIO3 !IORDY is possible */
271 ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST | 274 ap->flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_IORDY;
272 ATA_FLAG_NO_IORDY;
273 } 275 }
274 276
275 ae.sht = &qdi_sht; 277 ap->ioaddr.cmd_addr = io_addr;
276 ae.n_ports = 1; 278 ap->ioaddr.altstatus_addr = ctl_addr;
277 ae.irq = irq; 279 ap->ioaddr.ctl_addr = ctl_addr;
278 ae.irq_flags = 0; 280 ata_std_ports(&ap->ioaddr);
279 ae.port[0].cmd_addr = io_addr;
280 ae.port[0].altstatus_addr = ctl_addr;
281 ae.port[0].ctl_addr = ctl_addr;
282 ata_std_ports(&ae.port[0]);
283 281
284 /* 282 /*
285 * Hook in a private data structure per channel 283 * Hook in a private data structure per channel
286 */ 284 */
287 ae.private_data = &qdi_data[nr_qdi_host]; 285 ap->private_data = &qdi_data[nr_qdi_host];
288 286
289 qdi_data[nr_qdi_host].timing = port; 287 qdi_data[nr_qdi_host].timing = port;
290 qdi_data[nr_qdi_host].fast = fast; 288 qdi_data[nr_qdi_host].fast = fast;
@@ -292,8 +290,9 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i
292 290
293 printk(KERN_INFO DRV_NAME": qd%d at 0x%lx.\n", type, io); 291 printk(KERN_INFO DRV_NAME": qd%d at 0x%lx.\n", type, io);
294 292
295 ret = -ENODEV; 293 /* activate */
296 if (!ata_device_add(&ae)) 294 ret = ata_host_activate(host, irq, ata_interrupt, 0, &qdi_sht);
295 if (ret)
297 goto fail; 296 goto fail;
298 297
299 qdi_host[nr_qdi_host++] = dev_get_drvdata(&pdev->dev); 298 qdi_host[nr_qdi_host++] = dev_get_drvdata(&pdev->dev);