linux-kernelkernel-moduledma

How can I update `devm_ioremap_nocache` based kernel module


I am trying to understand this linux DMA driver

I am compiling it for this kernel

On compilation, I am getting the error:

drivers/dma/msgdma/msgdma.c:342:25: error: implicit declaration of function ‘devm_ioremap_nocache’; did you mean ‘devm_ioremap_release’? [-Werror=implicit-function-declaration]
  342 |     data->msgdma0_reg = devm_ioremap_nocache(dev, region->start+MSGDMA0_OFFSET, MSGDMA_MAP_SIZE);
      |                         ^~~~~~~~~~~~~~~~~~~~
      |                         devm_ioremap_release

I understand that this method has been deprecated, but cannot seem to find the correct resource to help me find the correct way to update it properly.

Is anybody able to provide a pointer on this topic?

I noticed on the kernel docs here and here that devm_ioremap_wc could be "Normal No-Cached" - should I use this instead?


Solution

  • devm_ioremap_nocache was removed since for all architectures it is the same as devm_ioremap (https://lore.kernel.org/linux-mips/20191209194819.GA28157@lst.de/T/). So, you can just use devm_ioremap.