remoteproc: st: Fix error return code in st_rproc_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 17 Oct 2016 16:23:35 +0000 (16:23 +0000)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 1 Nov 2016 00:36:10 +0000 (17:36 -0700)
Fix to return a negative error code from the st_rproc_state() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 63edb0310a5c ("remoteproc: Supply controller driver for ST's Remote Processors")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/st_remoteproc.c

index ae8963fcc8c8f8f2b0ccb3cedc43f2419eddb6f9..da4e152e97331fbed605887430dddbe22947c9ff 100644 (file)
@@ -245,8 +245,10 @@ static int st_rproc_probe(struct platform_device *pdev)
                goto free_rproc;
 
        enabled = st_rproc_state(pdev);
-       if (enabled < 0)
+       if (enabled < 0) {
+               ret = enabled;
                goto free_rproc;
+       }
 
        if (enabled) {
                atomic_inc(&rproc->power);