提交 11387b0a 编写于 作者: F Fabio Estevam 提交者: Greg Kroah-Hartman

serial: mxs-auart: Remove unneeded goto label

Instead of jumping to the 'out' label, let's return the error immediately, which
makes the code shorter and cleaner.
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3e29af27
......@@ -1232,10 +1232,8 @@ static int mxs_auart_probe(struct platform_device *pdev)
struct resource *r;
s = kzalloc(sizeof(struct mxs_auart_port), GFP_KERNEL);
if (!s) {
ret = -ENOMEM;
goto out;
}
if (!s)
return -ENOMEM;
ret = serial_mxs_probe_dt(s, pdev);
if (ret > 0)
......@@ -1314,7 +1312,6 @@ static int mxs_auart_probe(struct platform_device *pdev)
clk_put(s->clk);
out_free:
kfree(s);
out:
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册