jsm: removing the uart structure and filename on error
[safe/jmp/linux-2.6] / drivers / serial / imx.c
index 18130f1..d00fcf8 100644 (file)
@@ -1088,7 +1088,7 @@ imx_console_get_options(struct imx_port *sport, int *baud,
                           int *parity, int *bits)
 {
 
-       if ( readl(sport->port.membase + UCR1) | UCR1_UARTEN ) {
+       if (readl(sport->port.membase + UCR1) & UCR1_UARTEN) {
                /* ok, the port was enabled */
                unsigned int ucr2, ubir,ubmr, uartclk;
                unsigned int baud_raw;
@@ -1279,7 +1279,7 @@ static int serial_imx_probe(struct platform_device *pdev)
                sport->use_irda = 1;
 #endif
 
-       if (pdata->init) {
+       if (pdata && pdata->init) {
                ret = pdata->init(pdev);
                if (ret)
                        goto clkput;
@@ -1292,7 +1292,7 @@ static int serial_imx_probe(struct platform_device *pdev)
 
        return 0;
 deinit:
-       if (pdata->exit)
+       if (pdata && pdata->exit)
                pdata->exit(pdev);
 clkput:
        clk_put(sport->clk);
@@ -1321,7 +1321,7 @@ static int serial_imx_remove(struct platform_device *pdev)
 
        clk_disable(sport->clk);
 
-       if (pdata->exit)
+       if (pdata && pdata->exit)
                pdata->exit(pdev);
 
        iounmap(sport->port.membase);