Re: [PATCH] spi: rockchip-sfc: skip DMA cleanup in PIO mode
From: Mark Brown
Date: Fri Sep 11 2026 - 14:54:40 EST
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.
Attachment:
signature.asc
Description: PGP signature