Skip to content

Commit 96a30d7

Browse files
tititiou36andersson
authored andcommitted
remoteproc: imx_rproc: Re-use existing error handling path in 'imx_rproc_probe()'
Avoid some code ducplication and be more future-proof. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]>
1 parent de6f83f commit 96a30d7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/remoteproc/imx_rproc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ static int imx_rproc_probe(struct platform_device *pdev)
361361
priv->clk = devm_clk_get(dev, NULL);
362362
if (IS_ERR(priv->clk)) {
363363
dev_err(dev, "Failed to get clock\n");
364-
rproc_free(rproc);
365-
return PTR_ERR(priv->clk);
364+
ret = PTR_ERR(priv->clk);
365+
goto err_put_rproc;
366366
}
367367

368368
/*
@@ -372,8 +372,7 @@ static int imx_rproc_probe(struct platform_device *pdev)
372372
ret = clk_prepare_enable(priv->clk);
373373
if (ret) {
374374
dev_err(&rproc->dev, "Failed to enable clock\n");
375-
rproc_free(rproc);
376-
return ret;
375+
goto err_put_rproc;
377376
}
378377

379378
ret = rproc_add(rproc);

0 commit comments

Comments
 (0)