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 <dg@emlix.com> Signed-off-by: Oskar Schirmer <os@emlix.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2e1463922a
commit
9f322ad064
@ -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;
|
||||||
|
deinit:
|
||||||
|
if (pdata->exit)
|
||||||
|
pdata->exit(pdev);
|
||||||
clkput:
|
clkput:
|
||||||
clk_put(sport->clk);
|
clk_put(sport->clk);
|
||||||
clk_disable(sport->clk);
|
clk_disable(sport->clk);
|
||||||
|
Loading…
Reference in New Issue
Block a user