memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer()
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Thu, 26 Nov 2020 19:11:42 +0000 (19:11 +0000)
committerKrzysztof Kozlowski <krzk@kernel.org>
Sat, 28 Nov 2020 11:31:35 +0000 (12:31 +0100)
In the error path of rpcif_manual_xfer() the value of ret is overwritten
by value returned by reset_control_reset() function and thus returning
incorrect value to the caller.

This patch makes sure the correct value is returned to the caller of
rpcif_manual_xfer() by dropping the overwrite of ret in error path.
Also now we ignore the value returned by reset_control_reset() in the
error path and instead print a error message when it fails.

Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Pavel Machek (CIP) <pavel@denx.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20201126191146.8753-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
drivers/memory/renesas-rpc-if.c

index f2a33a1af836120a8c33747fb9ae0188d32a2522..69f2e2b4cd505c64066ba8344cb050b09740c32c 100644 (file)
@@ -508,7 +508,8 @@ exit:
        return ret;
 
 err_out:
-       ret = reset_control_reset(rpc->rstc);
+       if (reset_control_reset(rpc->rstc))
+               dev_err(rpc->dev, "Failed to reset HW\n");
        rpcif_hw_init(rpc, rpc->bus_size == 2);
        goto exit;
 }