[PATCH] libata: ahci: remove ata_port_start/stop() calls

This patch removes unnecessary ata_port_start/stop() calls from
ahci_port_start/stop().

Signed-off-by: Tejun Heo <htejun@gmail.com>
This commit is contained in:
Tejun Heo 2005-06-26 23:52:50 +09:00 committed by Jeff Garzik
parent 62ba2841f2
commit 0a139e7997

View File

@ -304,26 +304,19 @@ static int ahci_port_start(struct ata_port *ap)
struct device *dev = ap->host_set->dev; struct device *dev = ap->host_set->dev;
struct ahci_host_priv *hpriv = ap->host_set->private_data; struct ahci_host_priv *hpriv = ap->host_set->private_data;
struct ahci_port_priv *pp; struct ahci_port_priv *pp;
int rc;
void *mem, *mmio = ap->host_set->mmio_base; void *mem, *mmio = ap->host_set->mmio_base;
void *port_mmio = ahci_port_base(mmio, ap->port_no); void *port_mmio = ahci_port_base(mmio, ap->port_no);
dma_addr_t mem_dma; dma_addr_t mem_dma;
rc = ata_port_start(ap);
if (rc)
return rc;
pp = kmalloc(sizeof(*pp), GFP_KERNEL); pp = kmalloc(sizeof(*pp), GFP_KERNEL);
if (!pp) { if (!pp)
rc = -ENOMEM; return -ENOMEM;
goto err_out;
}
memset(pp, 0, sizeof(*pp)); memset(pp, 0, sizeof(*pp));
mem = dma_alloc_coherent(dev, AHCI_PORT_PRIV_DMA_SZ, &mem_dma, GFP_KERNEL); mem = dma_alloc_coherent(dev, AHCI_PORT_PRIV_DMA_SZ, &mem_dma, GFP_KERNEL);
if (!mem) { if (!mem) {
rc = -ENOMEM; kfree(pp);
goto err_out_kfree; return -ENOMEM;
} }
memset(mem, 0, AHCI_PORT_PRIV_DMA_SZ); memset(mem, 0, AHCI_PORT_PRIV_DMA_SZ);
@ -373,12 +366,6 @@ static int ahci_port_start(struct ata_port *ap)
readl(port_mmio + PORT_CMD); /* flush */ readl(port_mmio + PORT_CMD); /* flush */
return 0; return 0;
err_out_kfree:
kfree(pp);
err_out:
ata_port_stop(ap);
return rc;
} }
@ -404,7 +391,6 @@ static void ahci_port_stop(struct ata_port *ap)
dma_free_coherent(dev, AHCI_PORT_PRIV_DMA_SZ, dma_free_coherent(dev, AHCI_PORT_PRIV_DMA_SZ,
pp->cmd_slot, pp->cmd_slot_dma); pp->cmd_slot, pp->cmd_slot_dma);
kfree(pp); kfree(pp);
ata_port_stop(ap);
} }
static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg_in) static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg_in)