Re: [PATCH v2 2/2] spi: airoha: do not keep {tx,rx} dma buffer always mapped

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux