Skip to content

Commit 6c714d4

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: mesh: 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 32e7696 commit 6c714d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/scsi/mesh.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,8 +1915,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
19151915
/* We use the PCI APIs for now until the generic one gets fixed
19161916
* enough or until we get some macio-specific versions
19171917
*/
1918-
dma_cmd_space = pci_zalloc_consistent(macio_get_pci_dev(mdev),
1919-
ms->dma_cmd_size, &dma_cmd_bus);
1918+
dma_cmd_space = dma_zalloc_coherent(&macio_get_pci_dev(mdev)->dev,
1919+
ms->dma_cmd_size, &dma_cmd_bus, GFP_KERNEL);
19201920
if (dma_cmd_space == NULL) {
19211921
printk(KERN_ERR "mesh: can't allocate DMA table\n");
19221922
goto out_unmap;
@@ -1974,7 +1974,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
19741974
*/
19751975
mesh_shutdown(mdev);
19761976
set_mesh_power(ms, 0);
1977-
pci_free_consistent(macio_get_pci_dev(mdev), ms->dma_cmd_size,
1977+
dma_free_coherent(&macio_get_pci_dev(mdev)->dev, ms->dma_cmd_size,
19781978
ms->dma_cmd_space, ms->dma_cmd_bus);
19791979
out_unmap:
19801980
iounmap(ms->dma);
@@ -2007,7 +2007,7 @@ static int mesh_remove(struct macio_dev *mdev)
20072007
iounmap(ms->dma);
20082008

20092009
/* Free DMA commands memory */
2010-
pci_free_consistent(macio_get_pci_dev(mdev), ms->dma_cmd_size,
2010+
dma_free_coherent(&macio_get_pci_dev(mdev)->dev, ms->dma_cmd_size,
20112011
ms->dma_cmd_space, ms->dma_cmd_bus);
20122012

20132013
/* Release memory resources */

0 commit comments

Comments
 (0)