[PATCH 1/4] dmaengine: stm32-dma3: use module_platform_driver

Eugen Hristev eugen.hristev at linaro.org
Fri Nov 21 01:26:47 PST 2025



On 11/3/25 12:15, Amelie Delaunay wrote:
> Without module_platform_driver(), stm32-dma3 doesn't have a
> module_exit procedure. Once stm32-dma3 module is inserted, it
> can't be removed, marked busy.
> Use module_platform_driver() instead of subsys_initcall() to register
> (insmod) and unregister (rmmod) stm32-dma3 driver.
> 
> Signed-off-by: Amelie Delaunay <amelie.delaunay at foss.st.com>

Reviewed-by: Eugen Hristev <eugen.hristev at linaro.org>

> ---
>  drivers/dma/stm32/stm32-dma3.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/stm32/stm32-dma3.c b/drivers/dma/stm32/stm32-dma3.c
> index 50e7106c5cb7..9500164c8f68 100644
> --- a/drivers/dma/stm32/stm32-dma3.c
> +++ b/drivers/dma/stm32/stm32-dma3.c
> @@ -1914,12 +1914,7 @@ static struct platform_driver stm32_dma3_driver = {
>  	},
>  };
>  
> -static int __init stm32_dma3_init(void)
> -{
> -	return platform_driver_register(&stm32_dma3_driver);
> -}
> -
> -subsys_initcall(stm32_dma3_init);
> +module_platform_driver(stm32_dma3_driver);
>  
>  MODULE_DESCRIPTION("STM32 DMA3 controller driver");
>  MODULE_AUTHOR("Amelie Delaunay <amelie.delaunay at foss.st.com>");
> 




More information about the linux-arm-kernel mailing list