Commit 48ecddb41b741d4e530d88903757d26058fce2a5

Authored by Christoph Hellwig
Committed by Martin K. Petersen
1 parent 4d431b182e

scsi: atp870u: switch to generic DMA API

Switch from the legacy PCI DMA API to the generic DMA API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

drivers/scsi/atp870u.c
... ... @@ -1193,7 +1193,7 @@
1193 1193 for (k = 0; k < 16; k++) {
1194 1194 if (!atp_dev->id[j][k].prd_table)
1195 1195 continue;
1196   - pci_free_consistent(atp_dev->pdev, 1024, atp_dev->id[j][k].prd_table, atp_dev->id[j][k].prd_bus);
  1196 + dma_free_coherent(&atp_dev->pdev->dev, 1024, atp_dev->id[j][k].prd_table, atp_dev->id[j][k].prd_bus);
1197 1197 atp_dev->id[j][k].prd_table = NULL;
1198 1198 }
1199 1199 }
... ... @@ -1205,7 +1205,7 @@
1205 1205 int c,k;
1206 1206 for(c=0;c < 2;c++) {
1207 1207 for(k=0;k<16;k++) {
1208   - atp_dev->id[c][k].prd_table = pci_alloc_consistent(atp_dev->pdev, 1024, &(atp_dev->id[c][k].prd_bus));
  1208 + atp_dev->id[c][k].prd_table = dma_alloc_coherent(&atp_dev->pdev->dev, 1024, &(atp_dev->id[c][k].prd_bus), GFP_KERNEL);
1209 1209 if (!atp_dev->id[c][k].prd_table) {
1210 1210 printk("atp870u_init_tables fail\n");
1211 1211 atp870u_free_tables(host);
... ... @@ -1509,7 +1509,7 @@
1509 1509 if (err)
1510 1510 goto fail;
1511 1511  
1512   - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
  1512 + if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
1513 1513 printk(KERN_ERR "atp870u: DMA mask required but not available.\n");
1514 1514 err = -EIO;
1515 1515 goto disable_device;