Skip to content

Commit 99a31ad

Browse files
tititiou36andersson
authored andcommitted
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]>
1 parent 96a30d7 commit 99a31ad

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/remoteproc/imx_rproc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,8 @@ static int imx_rproc_probe(struct platform_device *pdev)
333333
/* set some other name then imx */
334334
rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops,
335335
NULL, sizeof(*priv));
336-
if (!rproc) {
337-
ret = -ENOMEM;
338-
goto err;
339-
}
336+
if (!rproc)
337+
return -ENOMEM;
340338

341339
dcfg = of_device_get_match_data(dev);
342340
if (!dcfg) {
@@ -381,13 +379,13 @@ static int imx_rproc_probe(struct platform_device *pdev)
381379
goto err_put_clk;
382380
}
383381

384-
return ret;
382+
return 0;
385383

386384
err_put_clk:
387385
clk_disable_unprepare(priv->clk);
388386
err_put_rproc:
389387
rproc_free(rproc);
390-
err:
388+
391389
return ret;
392390
}
393391

0 commit comments

Comments
 (0)