firmware: turris-mox-rwtm: Initialize completion before mailbox

[ Upstream commit 49e24c80d3 ]

Initialize the completion before the mailbox channel is requested.

Fixes: 389711b374 ("firmware: Add Turris Mox rWTM firmware driver")
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Marek Behún 2024-07-15 13:59:12 +02:00 committed by Greg Kroah-Hartman
parent 085dc94289
commit 1eb5751e23

View File

@ -496,6 +496,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;
@ -509,8 +510,6 @@ static int turris_mox_rwtm_probe(struct platform_device *pdev)
goto remove_files;
}
init_completion(&rwtm->cmd_done);
ret = mox_get_board_info(rwtm);
if (ret < 0)
dev_warn(dev, "Cannot read board information: %i\n", ret);