Skip to content

Commit

Permalink
imx: serial: handle initialisation failure correctly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Glöckner authored and Linus Torvalds committed Jun 11, 2009
1 parent 2e14639 commit 9f322ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9f322ad

Please sign in to comment.