[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210827203651.nzr2yrneg5rjo76k@kari-VirtualBox>
Date: Fri, 27 Aug 2021 23:36:51 +0300
From: Kari Argillander <kari.argillander@...il.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: tomas.winkler@...el.com, arnd@...db.de, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] mei: switch from 'pci_' to 'dma_' API
On Sun, Aug 22, 2021 at 10:02:59PM +0200, Christophe JAILLET wrote:
> The wrappers in include/linux/pci-dma-compat.h should go away.
>
> The patch has been generated with the coccinelle script below.
>
> It has been compile tested.
This should not be in commit message. It is unrelevant after this patch
is merged. It should be between
---
<here>
---
It is still good info to give.
Argillander
>
>
> @@
> @@
> - PCI_DMA_BIDIRECTIONAL
> + DMA_BIDIRECTIONAL
>
> @@
> @@
> - PCI_DMA_TODEVICE
> + DMA_TO_DEVICE
>
> @@
> @@
> - PCI_DMA_FROMDEVICE
> + DMA_FROM_DEVICE
>
> @@
> @@
> - PCI_DMA_NONE
> + DMA_NONE
>
> @@
> expression e1, e2, e3;
> @@
> - pci_alloc_consistent(e1, e2, e3)
> + dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
>
> @@
> expression e1, e2, e3;
> @@
> - pci_zalloc_consistent(e1, e2, e3)
> + dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_free_consistent(e1, e2, e3, e4)
> + dma_free_coherent(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_map_single(e1, e2, e3, e4)
> + dma_map_single(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_unmap_single(e1, e2, e3, e4)
> + dma_unmap_single(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4, e5;
> @@
> - pci_map_page(e1, e2, e3, e4, e5)
> + dma_map_page(&e1->dev, e2, e3, e4, e5)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_unmap_page(e1, e2, e3, e4)
> + dma_unmap_page(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_map_sg(e1, e2, e3, e4)
> + dma_map_sg(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_unmap_sg(e1, e2, e3, e4)
> + dma_unmap_sg(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
> + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_dma_sync_single_for_device(e1, e2, e3, e4)
> + dma_sync_single_for_device(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
> + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_dma_sync_sg_for_device(e1, e2, e3, e4)
> + dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
>
> @@
> expression e1, e2;
> @@
> - pci_dma_mapping_error(e1, e2)
> + dma_mapping_error(&e1->dev, e2)
>
> @@
> expression e1, e2;
> @@
> - pci_set_dma_mask(e1, e2)
> + dma_set_mask(&e1->dev, e2)
>
> @@
> expression e1, e2;
> @@
> - pci_set_consistent_dma_mask(e1, e2)
> + dma_set_coherent_mask(&e1->dev, e2)
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> If needed, see post from Christoph Hellwig on the kernel-janitors ML:
> https://marc.info/?l=kernel-janitors&m=158745678307186&w=4
> ---
> drivers/misc/mei/pci-txe.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c
> index aec0483b8e72..fa20d9a27813 100644
> --- a/drivers/misc/mei/pci-txe.c
> +++ b/drivers/misc/mei/pci-txe.c
> @@ -69,9 +69,9 @@ static int mei_txe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> goto end;
> }
>
> - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
> + err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(36));
> if (err) {
> - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
> + err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
> if (err) {
> dev_err(&pdev->dev, "No suitable DMA available.\n");
> goto end;
> --
> 2.30.2
>
Powered by blists - more mailing lists