]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
remoteproc: imx_rproc: Slightly simplify code in 'imx_rproc_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 14 Mar 2018 19:56:39 +0000 (20:56 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Sun, 18 Mar 2018 22:43:46 +0000 (15:43 -0700)
We can return directly at the beginning of the function and save the 'err'
label.
We can also explicitly return 0 when the probe succeed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/imx_rproc.c

index 6d02ef62a626f9ebe84a86a6f82d8d48ede633cb..54c07fd3f2042efdbf60d6a1feb6d891af0a76ee 100644 (file)
@@ -333,10 +333,8 @@ static int imx_rproc_probe(struct platform_device *pdev)
        /* set some other name then imx */
        rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops,
                            NULL, sizeof(*priv));
-       if (!rproc) {
-               ret = -ENOMEM;
-               goto err;
-       }
+       if (!rproc)
+               return -ENOMEM;
 
        dcfg = of_device_get_match_data(dev);
        if (!dcfg) {
@@ -381,13 +379,13 @@ static int imx_rproc_probe(struct platform_device *pdev)
                goto err_put_clk;
        }
 
-       return ret;
+       return 0;
 
 err_put_clk:
        clk_disable_unprepare(priv->clk);
 err_put_rproc:
        rproc_free(rproc);
-err:
+
        return ret;
 }