firmware: turris-mox-rwtm: fix reply status decoding function
authorMarek Behún <kabel@kernel.org>
Thu, 20 May 2021 11:35:17 +0000 (13:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:57 +0000 (16:05 +0200)
commit271c12dbeb62e53b10d45fe904b3dc7afb779aae
treea12207d139d1abbeaecf95abaf364e98c28dccdb
parent804aabb509908f42d660e1dd02f973e8efd1b226
firmware: turris-mox-rwtm: fix reply status decoding function

[ Upstream commit e34e60253d9272311831daed8a2d967cf80ca3dc ]

The status decoding function mox_get_status() currently contains an
incorrect check: if the error status is not MBOX_STS_SUCCESS, it always
returns -EIO, so the comparison to MBOX_STS_FAIL is never executed and
we don't get the actual error code sent by the firmware.

Fix this.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver")
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/turris-mox-rwtm.c