lkml.org 
[lkml]   [2022]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2022-01-03 09:48    [W:1.999 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site