X-Git-Url: https://git.karo-electronics.de/?p=karo-tx-linux.git;a=blobdiff_plain;f=drivers%2Fstaging%2Fet131x%2Fet131x.c;h=51a39d55ff665d61816f8c804af6dbd0bbdacf73;hp=7cd3d34707585c90f9155db6eac3b14ac59f9da8;hb=805b40af69321d436e60df1a2771d57f4e9b3780;hpb=29323b3e6bc65d95e2ef5add5db332fcb41ff2e6 diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 7cd3d3470758..51a39d55ff66 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -4790,21 +4790,8 @@ static int et131x_pci_setup(struct pci_dev *pdev, pci_set_master(pdev); /* Check the DMA addressing support of this device */ - if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { - rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); - if (rc < 0) { - dev_err(&pdev->dev, - "Unable to obtain 64 bit DMA for consistent allocations\n"); - goto err_release_res; - } - } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { - rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); - if (rc < 0) { - dev_err(&pdev->dev, - "Unable to obtain 32 bit DMA for consistent allocations\n"); - goto err_release_res; - } - } else { + if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) && + dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { dev_err(&pdev->dev, "No usable DMA addressing method\n"); rc = -EIO; goto err_release_res;