mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
imx: serial: handle initialisation failure correctly
correctly de-initialise device when setting up failed, call to pdata->exit() was missing. Signed-off-by: Daniel Glöckner <[email protected]> Signed-off-by: Oskar Schirmer <[email protected]> Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
2e1463922a
commit
9f322ad064
1 file changed
+6
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user