Merge 3.10-rc5 into tty-next
[deliverable/linux.git] / drivers / tty / serial / samsung.c
index 89429410a245e7b1d97b6602776a2b9be20881ab..81ebc86a9e23480fe2498093e96a44429f1d880a 100644 (file)
@@ -1166,6 +1166,18 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
                ourport->tx_irq = ret;
 
        ourport->clk    = clk_get(&platdev->dev, "uart");
+       if (IS_ERR(ourport->clk)) {
+               pr_err("%s: Controller clock not found\n",
+                               dev_name(&platdev->dev));
+               return PTR_ERR(ourport->clk);
+       }
+
+       ret = clk_prepare_enable(ourport->clk);
+       if (ret) {
+               pr_err("uart: clock failed to prepare+enable: %d\n", ret);
+               clk_put(ourport->clk);
+               return ret;
+       }
 
        /* Keep all interrupts masked and cleared */
        if (s3c24xx_serial_has_interrupt_mask(port)) {
@@ -1180,6 +1192,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
 
        /* reset the fifos (and setup the uart) */
        s3c24xx_serial_resetport(port, cfg);
+       clk_disable_unprepare(ourport->clk);
        return 0;
 }
 
@@ -1798,7 +1811,13 @@ static int __init s3c24xx_serial_modinit(void)
                return ret;
        }
 
-       return platform_driver_register(&samsung_serial_driver);
+       ret = platform_driver_register(&samsung_serial_driver);
+       if (ret < 0) {
+               pr_err("Failed to register platform driver\n");
+               uart_unregister_driver(&s3c24xx_uart_drv);
+       }
+
+       return ret;
 }
 
 static void __exit s3c24xx_serial_modexit(void)
This page took 0.030175 seconds and 5 git commands to generate.