diff mbox series

[v2,12/17] firmware: turris-mox-rwtm: Initialize completion before mailbox

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

Commit Message

Marek Behún June 13, 2024, 4:10 p.m. UTC
Initialize the completion before the mailbox channel is requested.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
 drivers/firmware/turris-mox-rwtm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andy Shevchenko June 13, 2024, 8:56 p.m. UTC | #1
On Thu, Jun 13, 2024 at 6:11 PM Marek Behún <kabel@kernel.org> wrote:
>
> Initialize the completion before the mailbox channel is requested.

Sounds like a fix, does it need the Fixes tag?
diff mbox series

Patch

diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index 81a82b1ef515..35c2a899caab 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -454,6 +454,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;
@@ -472,8 +473,6 @@  static int turris_mox_rwtm_probe(struct platform_device *pdev)
 	if (ret < 0)
 		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);