Skip to contentSkip to conversation

dmaengine: at_xdmac: use platform_driver_register

PATCH Applied Clément Léger 2 participants 2 messages Jul 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dmaengine: at_xdmac: use platform_driver_register

When using SCMI clocks, the clocks are probed later than subsys initcall level. This driver uses platform_driver_probe which is not compatible with deferred probing and won't be probed again later if probe function fails due to clocks not being available at that time.

This patch replaces the use of platform_driver_probe with platform_driver_register which will allow probing the driver later again when clocks will be available.

---
 drivers/dma/at_xdmac.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/dma/at_xdmac.c +7 -1
index 64a52bf4d737..ab78e0f6afd7 100644
@@ -2240,10 +2240,16 @@ static struct platform_driver at_xdmac_driver = {
 
 static int __init at_xdmac_init(void)
 {
-	return platform_driver_probe(&at_xdmac_driver, at_xdmac_probe);
+	return platform_driver_register(&at_xdmac_driver);
 }
 subsys_initcall(at_xdmac_init);
 
+static void __exit at_xdmac_exit(void)
+{
+	platform_driver_unregister(&at_xdmac_driver);
+}
+module_exit(at_xdmac_exit);
+
 MODULE_DESCRIPTION("Atmel Extended DMA Controller driver");
 MODULE_AUTHOR("Ludovic Desroches <[email protected]>");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Clément Léger

When using SCMI clocks, the clocks are probed later than subsys initcall level. This driver uses platform_driver_probe which is not compatible with deferred probing and won't be probed again later if probe function fails due to clocks not being available at that time.

This patch replaces the use of platform_driver_probe with platform_driver_register which will allow probing the driver later again when clocks will be available.

Applied, thanks

Signature · 1 line
~Vinod