Messages in this thread | | | Date | Mon, 3 Jan 2022 00:47:28 -0800 | From | Christoph Hellwig <> | Subject | Re: [PATCH] enic: Use dma_set_mask_and_coherent() |
| |
On Sat, Jan 01, 2022 at 03:02:45PM +0100, Christophe JAILLET wrote: > - err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(47)); > + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(47)); > if (err) { > + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); > if (err) { > dev_err(dev, "No usable DMA configuration, aborting\n"); > goto err_out_release_regions; > } > } else { > using_dac = 1;
There is no need for the callback. All the routines to set a DMA mask will only fail if the passed in mask is too small, but never if it is larger than what is supported. Also the using_dac variable is not needed, NETIF_F_HIGHDMA can and should be set unconditionally.
| |