aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index ae2475e4291c..e1346cddd37f 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4091,15 +4091,16 @@ err_out:
4091int ata_port_start (struct ata_port *ap) 4091int ata_port_start (struct ata_port *ap)
4092{ 4092{
4093 struct device *dev = ap->host_set->dev; 4093 struct device *dev = ap->host_set->dev;
4094 int rc;
4094 4095
4095 ap->prd = dma_alloc_coherent(dev, ATA_PRD_TBL_SZ, &ap->prd_dma, GFP_KERNEL); 4096 ap->prd = dma_alloc_coherent(dev, ATA_PRD_TBL_SZ, &ap->prd_dma, GFP_KERNEL);
4096 if (!ap->prd) 4097 if (!ap->prd)
4097 return -ENOMEM; 4098 return -ENOMEM;
4098 4099
4099 ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ, &ap->pad_dma, GFP_KERNEL); 4100 rc = ata_pad_alloc(ap, dev);
4100 if (!ap->pad) { 4101 if (rc) {
4101 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma); 4102 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);
4102 return -ENOMEM; 4103 return rc;
4103 } 4104 }
4104 4105
4105 DPRINTK("prd alloc, virt %p, dma %llx\n", ap->prd, (unsigned long long) ap->prd_dma); 4106 DPRINTK("prd alloc, virt %p, dma %llx\n", ap->prd, (unsigned long long) ap->prd_dma);
@@ -4125,7 +4126,7 @@ void ata_port_stop (struct ata_port *ap)
4125 struct device *dev = ap->host_set->dev; 4126 struct device *dev = ap->host_set->dev;
4126 4127
4127 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma); 4128 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);
4128 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); 4129 ata_pad_free(ap, dev);
4129} 4130}
4130 4131
4131void ata_host_stop (struct ata_host_set *host_set) 4132void ata_host_stop (struct ata_host_set *host_set)