提交 9f322ad0 编写于 作者: D Daniel Glöckner 提交者: Linus Torvalds

imx: serial: handle initialisation failure correctly

correctly de-initialise device when setting up failed,
call to pdata->exit() was missing.
Signed-off-by: NDaniel Glöckner <dg@emlix.com>
Signed-off-by: NOskar Schirmer <os@emlix.com>
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 2e146392
......@@ -1157,10 +1157,15 @@ static int serial_imx_probe(struct platform_device *pdev)
goto clkput;
}
uart_add_one_port(&imx_reg, &sport->port);
ret = uart_add_one_port(&imx_reg, &sport->port);
if (ret)
goto deinit;
platform_set_drvdata(pdev, &sport->port);
return 0;
deinit:
if (pdata->exit)
pdata->exit(pdev);
clkput:
clk_put(sport->clk);
clk_disable(sport->clk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册