diff options
author | Daniel Glöckner <dg@emlix.com> | 2009-06-11 15:39:21 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-11 17:51:08 +0200 |
commit | 9f322ad064f9210e7d472dfe77e702274d5c9dba (patch) | |
tree | e7799ca401c1334e9c4bea40b02e7a5b6214a392 /drivers/serial/imx.c | |
parent | imx: serial: be sure to stop xmit upon shutdown (diff) | |
download | linux-9f322ad064f9210e7d472dfe77e702274d5c9dba.tar.xz linux-9f322ad064f9210e7d472dfe77e702274d5c9dba.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/serial/imx.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); |