mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
remoteproc: imx_rproc: Slightly simplify code in 'imx_rproc_probe()'
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 <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]>
This commit is contained in:
1 parent
96a30d7f91
commit
99a31adfb2
1 file changed
+4
-6
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user