Commit 9f322ad0 authored by Daniel Glöckner's avatar Daniel Glöckner Committed by Linus Torvalds
Browse files

imx: serial: handle initialisation failure correctly

correctly de-initialise device when setting up failed,
call to pdata->exit() was missing.
Signed-off-by: default avatarDaniel Glöckner <>
Signed-off-by: default avatarOskar Schirmer <>
Signed-off-by: default avatarAlan Cox <>
Signed-off-by: default avatarLinus Torvalds <>
parent 2e146392
...@@ -1157,10 +1157,15 @@ static int serial_imx_probe(struct platform_device *pdev) ...@@ -1157,10 +1157,15 @@ static int serial_imx_probe(struct platform_device *pdev)
goto clkput; 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); platform_set_drvdata(pdev, &sport->port);
return 0; return 0;
if (pdata->exit)
clkput: clkput:
clk_put(sport->clk); clk_put(sport->clk);
clk_disable(sport->clk); clk_disable(sport->clk);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment