[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20241123085540.1470530-1-zhangheng@kylinos.cn>
Date: Sat, 23 Nov 2024 16:55:40 +0800
From: zhangheng <zhangheng@...inos.cn>
To: khc@...waw.pl,
andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
zhangheng <zhangheng@...inos.cn>
Subject: [PATCH] net: wan: replace dma_set_mask()+dma_set_coherent_mask() with new helper
Replace the following sequence:
dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);
with a call to the new helper dma_set_mask_and_coherent().
Signed-off-by: zhangheng <zhangheng@...inos.cn>
---
drivers/net/wan/wanxl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index 5a9e262188ef..c2d5fbf887ee 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -574,8 +574,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
* and pray pci_alloc_consistent() will use this info. It should
* work on most platforms
*/
- if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(28)) ||
- dma_set_mask(&pdev->dev, DMA_BIT_MASK(28))) {
+ if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(28))) {
pr_err("No usable DMA configuration\n");
pci_disable_device(pdev);
return -EIO;
@@ -626,8 +625,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
* We set both dma_mask and consistent_dma_mask back to 32 bits
* to indicate the card can do 32-bit DMA addressing
*/
- if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)) ||
- dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
+ if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
pr_err("No usable DMA configuration\n");
wanxl_pci_remove_one(pdev);
return -EIO;
--
2.45.2
Powered by blists - more mailing lists