[PATCH v3 6/7] dmaengine: stm32-dmamux: Use managed DMA router registration
Frank Li
Frank.li at oss.nxp.com
Fri Dec 4 09:57:00 PST 2026
On Fri, Dec 04, 2026 at 08:16:29PM +0800, Tian Xuechen wrote:
> The STM32 DMAMUX registers an OF DMA router backed by managed driver
> data. The router entry can outlive that data when the device is
> detached.
>
> Use devm_of_dma_router_register() to remove the entry before devres
> releases the router data. Keep the probe error unwind for runtime PM
> and clocks when registration fails.
>
> Fixes: df7e762db5f6 ("dmaengine: Add STM32 DMAMUX driver")
> Cc: stable+noautosel at kernel.org # relies on new API
> Signed-off-by: Tian Xuechen <202300460064 at mail.sdu.edu.cn>
> ---
Reviewed-by: Frank Li <Frank.Li at nxp.com>
> drivers/dma/stm32/stm32-dmamux.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/stm32/stm32-dmamux.c b/drivers/dma/stm32/stm32-dmamux.c
> index b3cacd57b..3cb9d4051 100644
> --- a/drivers/dma/stm32/stm32-dmamux.c
> +++ b/drivers/dma/stm32/stm32-dmamux.c
> @@ -290,8 +290,9 @@ static int stm32_dmamux_probe(struct platform_device *pdev)
>
> pm_runtime_put(&pdev->dev);
>
> - ret = of_dma_router_register(node, stm32_dmamux_route_allocate,
> - &stm32_dmamux->dmarouter);
> + ret = devm_of_dma_router_register(&pdev->dev, node,
> + stm32_dmamux_route_allocate,
> + &stm32_dmamux->dmarouter);
> if (ret)
> goto pm_disable;
>
More information about the linux-arm-kernel
mailing list