diff options
author | Tejun Heo <htejun@gmail.com> | 2007-04-17 10:44:08 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 14:16:06 -0400 |
commit | 5d728824efeda61d304153bfcf1378a3c18b7d70 (patch) | |
tree | 8a3d4ba0c1c650da5c161f11155e7c19f0fe78aa /drivers/ata/pata_mpc52xx.c | |
parent | 4447d35156169cf136e829eb6b5cac2d6370f2d9 (diff) |
libata: convert the remaining PATA drivers to new init model
Convert pdc_adma, pata_cs5520, pata_isapnp, pata_ixp4xx_cf,
pata_legacy, pata_mpc52xx, pata_mpiix, pata_pcmcia, pata_pdc2027x,
pata_platform, pata_qdi, pata_scc and pata_winbond to new init model.
* init_one()'s now follow more consistent init order
* cs5520 now registers one host with two ports, not two hosts. If any
of the two ports are disabled, it's made dummy as other drivers do.
Tested pdc_adma and pata_legacy. Both are as broken as before. The
rest are compile tested only.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_mpc52xx.c')
-rw-r--r-- | drivers/ata/pata_mpc52xx.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index 77b57321ff52..9587a89f9683 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
@@ -301,35 +301,33 @@ static struct ata_port_operations mpc52xx_ata_port_ops = { | |||
301 | .qc_prep = ata_qc_prep, | 301 | .qc_prep = ata_qc_prep, |
302 | .qc_issue = ata_qc_issue_prot, | 302 | .qc_issue = ata_qc_issue_prot, |
303 | .data_xfer = ata_data_xfer, | 303 | .data_xfer = ata_data_xfer, |
304 | .irq_handler = ata_interrupt, | ||
305 | .irq_clear = ata_bmdma_irq_clear, | 304 | .irq_clear = ata_bmdma_irq_clear, |
306 | .irq_on = ata_irq_on, | 305 | .irq_on = ata_irq_on, |
307 | .irq_ack = ata_irq_ack, | 306 | .irq_ack = ata_irq_ack, |
308 | .port_start = ata_port_start, | 307 | .port_start = ata_port_start, |
309 | }; | 308 | }; |
310 | 309 | ||
311 | static struct ata_probe_ent mpc52xx_ata_probe_ent = { | ||
312 | .port_ops = &mpc52xx_ata_port_ops, | ||
313 | .sht = &mpc52xx_ata_sht, | ||
314 | .n_ports = 1, | ||
315 | .pio_mask = 0x1f, /* Up to PIO4 */ | ||
316 | .mwdma_mask = 0x00, /* No MWDMA */ | ||
317 | .udma_mask = 0x00, /* No UDMA */ | ||
318 | .port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | ||
319 | .irq_flags = 0, | ||
320 | }; | ||
321 | |||
322 | static int __devinit | 310 | static int __devinit |
323 | mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv) | 311 | mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv) |
324 | { | 312 | { |
325 | struct ata_probe_ent *ae = &mpc52xx_ata_probe_ent; | 313 | struct ata_host *host; |
326 | struct ata_ioports *aio = &ae->port[0]; | 314 | struct ata_port *ap; |
327 | int rv; | 315 | struct ata_ioports *aio; |
328 | 316 | int rc; | |
329 | INIT_LIST_HEAD(&ae->node); | 317 | |
330 | ae->dev = dev; | 318 | host = ata_host_alloc(dev, 1); |
331 | ae->irq = priv->ata_irq; | 319 | if (!host) |
332 | 320 | return -ENOMEM; | |
321 | |||
322 | ap = host->ports[0]; | ||
323 | ap->flags |= ATA_FLAG_SLAVE_POSS; | ||
324 | ap->pio_mask = 0x1f; /* Up to PIO4 */ | ||
325 | ap->mwdma_mask = 0x00; /* No MWDMA */ | ||
326 | ap->udma_mask = 0x00; /* No UDMA */ | ||
327 | ap->ops = &mpc52xx_ata_port_ops; | ||
328 | host->private_data = priv; | ||
329 | |||
330 | aio = &ap->ioaddr; | ||
333 | aio->cmd_addr = NULL; /* Don't have a classic reg block */ | 331 | aio->cmd_addr = NULL; /* Don't have a classic reg block */ |
334 | aio->altstatus_addr = &priv->ata_regs->tf_control; | 332 | aio->altstatus_addr = &priv->ata_regs->tf_control; |
335 | aio->ctl_addr = &priv->ata_regs->tf_control; | 333 | aio->ctl_addr = &priv->ata_regs->tf_control; |
@@ -344,11 +342,9 @@ mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv) | |||
344 | aio->status_addr = &priv->ata_regs->tf_command; | 342 | aio->status_addr = &priv->ata_regs->tf_command; |
345 | aio->command_addr = &priv->ata_regs->tf_command; | 343 | aio->command_addr = &priv->ata_regs->tf_command; |
346 | 344 | ||
347 | ae->private_data = priv; | 345 | /* activate host */ |
348 | 346 | return ata_host_activate(host, priv->ata_irq, ata_interrupt, 0, | |
349 | rv = ata_device_add(ae); | 347 | &mpc52xx_ata_sht); |
350 | |||
351 | return rv ? 0 : -EINVAL; | ||
352 | } | 348 | } |
353 | 349 | ||
354 | static struct mpc52xx_ata_priv * | 350 | static struct mpc52xx_ata_priv * |