dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dmaengine: at_xdmac: use platform_driver_register
@ 2021-07-28  9:46 Clément Léger
  2021-07-28 10:51 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Clément Léger @ 2021-07-28  9:46 UTC (permalink / raw)
  To: Ludovic Desroches, Tudor Ambarus, Vinod Koul
  Cc: Clément Léger, Alexandre Belloni, linux-arm-kernel,
	dmaengine, linux-kernel

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.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 drivers/dma/at_xdmac.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index 64a52bf4d737..ab78e0f6afd7 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -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 <ludovic.desroches@atmel.com>");
 MODULE_LICENSE("GPL");
-- 
2.32.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] dmaengine: at_xdmac: use platform_driver_register
  2021-07-28  9:46 [PATCH v2] dmaengine: at_xdmac: use platform_driver_register Clément Léger
@ 2021-07-28 10:51 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2021-07-28 10:51 UTC (permalink / raw)
  To: Clément Léger
  Cc: Ludovic Desroches, Tudor Ambarus, Alexandre Belloni,
	linux-arm-kernel, dmaengine, linux-kernel

On 28-07-21, 11:46, Clément Léger wrote:
> 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

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-28 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28  9:46 [PATCH v2] dmaengine: at_xdmac: use platform_driver_register Clément Léger
2021-07-28 10:51 ` Vinod Koul

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox