From: Daniel Glöckner Date: Thu, 11 Jun 2009 13:39:21 +0000 (+0100) Subject: imx: serial: handle initialisation failure correctly X-Git-Tag: v3.0~9040^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f322ad064f9210e7d472dfe77e702274d5c9dba;p=platform%2Fkernel%2Flinux-amlogic.git 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 Signed-off-by: Oskar Schirmer Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index e6c2ba2..cbd4f32 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c @@ -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);