Skip to content

Commit 48ecddb

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
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>
1 parent 4d431b1 commit 48ecddb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/atp870u.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ static void atp870u_free_tables(struct Scsi_Host *host)
11931193
for (k = 0; k < 16; k++) {
11941194
if (!atp_dev->id[j][k].prd_table)
11951195
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);
11971197
atp_dev->id[j][k].prd_table = NULL;
11981198
}
11991199
}
@@ -1205,7 +1205,7 @@ static int atp870u_init_tables(struct Scsi_Host *host)
12051205
int c,k;
12061206
for(c=0;c < 2;c++) {
12071207
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);
12091209
if (!atp_dev->id[c][k].prd_table) {
12101210
printk("atp870u_init_tables fail\n");
12111211
atp870u_free_tables(host);
@@ -1509,7 +1509,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
15091509
if (err)
15101510
goto fail;
15111511

1512-
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
1512+
if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
15131513
printk(KERN_ERR "atp870u: DMA mask required but not available.\n");
15141514
err = -EIO;
15151515
goto disable_device;

0 commit comments

Comments
 (0)