]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
i.MX serial: fix init failure
authorDarius Augulis <augulis.darius@gmail.com>
Tue, 2 Sep 2008 08:19:29 +0000 (10:19 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Tue, 2 Sep 2008 08:19:29 +0000 (10:19 +0200)
Adds extra "out" label to probe function after calling .init form platform data.
Because .init can return error number caused by gpio request fail.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
drivers/serial/imx.c

index 6a29f9330a73c72d7799a83ce66a8ecd9a7e5588..20189c447e92abc954c5e54a34175c95f9d88721 100644 (file)
@@ -1133,13 +1133,19 @@ static int serial_imx_probe(struct platform_device *pdev)
        if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS))
                sport->have_rtscts = 1;
 
-       if (pdata->init)
-               pdata->init(pdev);
+       if (pdata->init) {
+               ret = pdata->init(pdev);
+               if (ret)
+                       goto clkput;
+       }
 
        uart_add_one_port(&imx_reg, &sport->port);
        platform_set_drvdata(pdev, &sport->port);
 
        return 0;
+clkput:
+       clk_put(sport->clk);
+       clk_disable(sport->clk);
 unmap:
        iounmap(sport->port.membase);
 free: