diff mbox series

[v4,13/19] firmware: turris-mox-rwtm: Initialize completion before mailbox

Message ID 20240715104723.17751-14-kabel@kernel.org (mailing list archive)
State Superseded
Headers show
Series Updates for turris-mox-rwtm driver | expand

Commit Message

Marek BehĂșn July 15, 2024, 10:47 a.m. UTC
Initialize the completion before the mailbox channel is requested.

Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver")
Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
---
 drivers/firmware/turris-mox-rwtm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index 30c124e664d9..f291df9a72ff 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -453,6 +453,7 @@  static int turris_mox_rwtm_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, rwtm);
 
 	mutex_init(&rwtm->busy);
+	init_completion(&rwtm->cmd_done);
 
 	rwtm->mbox_client.dev = dev;
 	rwtm->mbox_client.rx_callback = mox_rwtm_rx_callback;
@@ -466,8 +467,6 @@  static int turris_mox_rwtm_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	init_completion(&rwtm->cmd_done);
-
 	ret = mox_get_board_info(rwtm);
 	if (ret < 0)
 		dev_warn(dev, "Cannot read board information: %i\n", ret);