[PATCH] spi: rockchip-sfc: skip DMA cleanup in PIO mode

Mark Brown broonie at kernel.org
Fri Sep 11 11:47:51 PDT 2026


On Fri, Sep 11, 2026 at 01:27:01PM -0400, Myeonghun Pak wrote:
> With rockchip,sfc-no-dma, probe skips allocating and mapping the transfer
> buffer. However, controller registration failure and driver removal still
> call dma_unmap_single() for that nonexistent mapping.

>  err_register:
> +	if (!sfc->use_dma)
> +		goto err_dma;
>  	dma_unmap_single(dev, sfc->dma_buffer, sfc->max_iosize,
>  			 DMA_BIDIRECTIONAL);

Rather than adding use of goto to skip aroud within the cleanup here you
could guard the calls that need guarding with if statements, that would
look a lot less scary than jumping around like this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260911/c71b26c1/attachment.sig>


More information about the linux-arm-kernel mailing list