All of lore.kernel.org
 help / color / mirror / Atom feed
From: "jiangheng (G)" <jiangheng14@huawei.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [[PATCH] ] linux/igb_uio: fix build with Linux 5.18
Date: Mon, 30 Jan 2023 07:27:01 +0000	[thread overview]
Message-ID: <8b4953ef939d433f8fe19353e9ed3aa7@huawei.com> (raw)

Since commit 7968778914 (PCI: Remove the deprecated "pci-dma-compat.h" API)
in 5.18, pci_set_dma_mask() and pci_set_consistent_dma_mask() no longer exist
switch those api to dma_set_mask_and_coherent.
---
 linux/igb_uio/igb_uio.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
index 33e0e02..3672314 100644
--- a/linux/igb_uio/igb_uio.c
+++ b/linux/igb_uio/igb_uio.c
@@ -512,13 +512,21 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		goto fail_release_iomem;
 
 	/* set 64-bit DMA mask */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
 	err = pci_set_dma_mask(dev,  DMA_BIT_MASK(64));
+#else
+	err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
+#endif
 	if (err != 0) {
 		dev_err(&dev->dev, "Cannot set DMA mask\n");
 		goto fail_release_iomem;
 	}
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
 	err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64));
+#else
+	err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
+#endif
 	if (err != 0) {
 		dev_err(&dev->dev, "Cannot set consistent DMA mask\n");
 		goto fail_release_iomem;
-- 
2.27.0


             reply	other threads:[~2023-01-30  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  7:27 jiangheng (G) [this message]
2023-02-05 17:34 ` [[PATCH] ] linux/igb_uio: fix build with Linux 5.18 Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b4953ef939d433f8fe19353e9ed3aa7@huawei.com \
    --to=jiangheng14@huawei.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.