提交 48ecddb4 编写于 作者: C Christoph Hellwig 提交者: Martin K. Petersen

scsi: atp870u: switch to generic DMA API

Switch from the legacy PCI DMA API to the generic DMA API.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 4d431b18
...@@ -1193,7 +1193,7 @@ static void atp870u_free_tables(struct Scsi_Host *host) ...@@ -1193,7 +1193,7 @@ static void atp870u_free_tables(struct Scsi_Host *host)
for (k = 0; k < 16; k++) { for (k = 0; k < 16; k++) {
if (!atp_dev->id[j][k].prd_table) if (!atp_dev->id[j][k].prd_table)
continue; continue;
pci_free_consistent(atp_dev->pdev, 1024, atp_dev->id[j][k].prd_table, atp_dev->id[j][k].prd_bus); dma_free_coherent(&atp_dev->pdev->dev, 1024, atp_dev->id[j][k].prd_table, atp_dev->id[j][k].prd_bus);
atp_dev->id[j][k].prd_table = NULL; atp_dev->id[j][k].prd_table = NULL;
} }
} }
...@@ -1205,7 +1205,7 @@ static int atp870u_init_tables(struct Scsi_Host *host) ...@@ -1205,7 +1205,7 @@ static int atp870u_init_tables(struct Scsi_Host *host)
int c,k; int c,k;
for(c=0;c < 2;c++) { for(c=0;c < 2;c++) {
for(k=0;k<16;k++) { for(k=0;k<16;k++) {
atp_dev->id[c][k].prd_table = pci_alloc_consistent(atp_dev->pdev, 1024, &(atp_dev->id[c][k].prd_bus)); atp_dev->id[c][k].prd_table = dma_alloc_coherent(&atp_dev->pdev->dev, 1024, &(atp_dev->id[c][k].prd_bus), GFP_KERNEL);
if (!atp_dev->id[c][k].prd_table) { if (!atp_dev->id[c][k].prd_table) {
printk("atp870u_init_tables fail\n"); printk("atp870u_init_tables fail\n");
atp870u_free_tables(host); atp870u_free_tables(host);
...@@ -1509,7 +1509,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1509,7 +1509,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err) if (err)
goto fail; goto fail;
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
printk(KERN_ERR "atp870u: DMA mask required but not available.\n"); printk(KERN_ERR "atp870u: DMA mask required but not available.\n");
err = -EIO; err = -EIO;
goto disable_device; goto disable_device;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册