From: Daniel Glöckner Date: Thu, 11 Jun 2009 13:39:21 +0000 (+0100) Subject: imx: serial: handle initialisation failure correctly X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9f322ad064f9210e7d472dfe77e702274d5c9dba;p=openwrt%2Fstaging%2Fblogic.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 e6c2ba26dcbb..cbd4f3224643 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);