[PATCH 6.19 365/844] dmaengine: stm32-dma3: use module_platform_driver
From: Sasha Levin
Date: Sat Feb 28 2026 - 13:59:23 EST
From: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
[ Upstream commit 0d41ed4ea496fabbb4dc21171e32d9a924c2a661 ]
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.
Reviewed-by: Eugen Hristev <eugen.hristev@xxxxxxxxxx>
Signed-off-by: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
Link: https://patch.msgid.link/20251121-dma3_improv-v2-1-76a207b13ea6@xxxxxxxxxxx
Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
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 50e7106c5cb73..9500164c8f688 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@xxxxxxxxxxx>");
--
2.51.0