[PATCH] net: wan: replace dma_set_mask()+dma_set_coherent_mask() with new helper

zhangheng posted 1 patch 1 year, 2 months ago
drivers/net/wan/wanxl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] net: wan: replace dma_set_mask()+dma_set_coherent_mask() with new helper
Posted by zhangheng 1 year, 2 months ago
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@kylinos.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