On Thu, Sep 19, 2024 at 06:57:17PM +0200, Lorenzo Bianconi wrote: > DMA map txrx_buf on demand in airoha_snand_dirmap_read and > airoha_snand_dirmap_write routines and do not keep it always mapped. > This patch is not fixing any bug or introducing any functional change > to the driver, it just simplifies the code and improve code readability > without introducing any performance degradation according to the results > obtained from the mtd_speedtest kernel module test. ... > + dma_addr = dma_map_single(as_ctrl->dev, txrx_buf, SPI_NAND_CACHE_SIZE, > + DMA_FROM_DEVICE); > + if (dma_mapping_error(as_ctrl->dev, dma_addr)) > + return -ENOMEM; Shouldn't this be err = dma_mapping_error(as_ctrl->dev, dma_addr); if (err) return err; ? ... > + dma_addr = dma_map_single(as_ctrl->dev, txrx_buf, SPI_NAND_CACHE_SIZE, > + DMA_TO_DEVICE); > + if (dma_mapping_error(as_ctrl->dev, dma_addr)) > + return -ENOMEM; Ditto. -- With Best Regards, Andy Shevchenko