[PATCH] net: wan: replace dma_set_mask()+dma_set_coherent_mask() with new helper
From: zhangheng
Date: Sat Nov 23 2024 - 03:56:03 EST
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@xxxxxxxxxx>
---
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