[PATCH 1/2] dmaengine: lpc18xx-dmamux: Unregister the DMA router on removal
Frank Li
Frank.li at oss.nxp.com
Thu Nov 26 08:03:38 PST 2026
On Thu, Nov 26, 2026 at 09:28:05PM +0800, Tian Xuechen wrote:
> [You don't often get email from 202300460064 at mail.sdu.edu.cn. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Tian Xuechen <202300460064 at mail.sdu.edu.cn>
>
> The DMA router remains in the OF registry after its device-managed
> data is released. Remove the routing entry when the device is
> unbound.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: e5f4ae84be74 ("dmaengine: add driver for lpc18xx dmamux")
> Signed-off-by: Tian Xuechen <202300460064 at mail.sdu.edu.cn>
> ---
> drivers/dma/lpc18xx-dmamux.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/dma/lpc18xx-dmamux.c b/drivers/dma/lpc18xx-dmamux.c
> index 40a338f0d44b..412d425dc1ab 100644
> --- a/drivers/dma/lpc18xx-dmamux.c
> +++ b/drivers/dma/lpc18xx-dmamux.c
> @@ -169,6 +169,11 @@ static int lpc18xx_dmamux_probe(struct platform_device *pdev)
> &dmamux->dmarouter);
> }
>
> +static void lpc18xx_dmamux_remove(struct platform_device *pdev)
> +{
> + of_dma_router_free(pdev->dev.of_node);
> +}
> +
> static const struct of_device_id lpc18xx_dmamux_match[] = {
> { .compatible = "nxp,lpc1850-dmamux" },
> {},
> @@ -176,6 +181,7 @@ static const struct of_device_id lpc18xx_dmamux_match[] = {
>
> static struct platform_driver lpc18xx_dmamux_driver = {
> .probe = lpc18xx_dmamux_probe,
> + .remove = lpc18xx_dmamux_remove,
DMA engine driver almost never unload. so it is not urgent.
Please add devm_of_dma_router_register() API, other mux router also can use
it
Frank
> .driver = {
> .name = "lpc18xx-dmamux",
> .of_match_table = lpc18xx_dmamux_match,
>
> --
> 2.43.0
>
More information about the linux-arm-kernel
mailing list