These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / tty / serial / altera_uart.c
index b2859fe..61b607f 100644 (file)
@@ -493,7 +493,7 @@ console_initcall(altera_uart_console_init);
 
 #define        ALTERA_UART_CONSOLE     NULL
 
-#endif /* CONFIG_ALTERA_UART_CONSOLE */
+#endif /* CONFIG_SERIAL_ALTERA_UART_CONSOLE */
 
 /*
  *     Define the altera_uart UART driver structure.
@@ -508,29 +508,6 @@ static struct uart_driver altera_uart_driver = {
        .cons           = ALTERA_UART_CONSOLE,
 };
 
-#ifdef CONFIG_OF
-static int altera_uart_get_of_uartclk(struct platform_device *pdev,
-                                     struct uart_port *port)
-{
-       int len;
-       const __be32 *clk;
-
-       clk = of_get_property(pdev->dev.of_node, "clock-frequency", &len);
-       if (!clk || len < sizeof(__be32))
-               return -ENODEV;
-
-       port->uartclk = be32_to_cpup(clk);
-
-       return 0;
-}
-#else
-static int altera_uart_get_of_uartclk(struct platform_device *pdev,
-                                     struct uart_port *port)
-{
-       return -ENODEV;
-}
-#endif /* CONFIG_OF */
-
 static int altera_uart_probe(struct platform_device *pdev)
 {
        struct altera_uart_platform_uart *platp = dev_get_platdata(&pdev->dev);
@@ -570,7 +547,8 @@ static int altera_uart_probe(struct platform_device *pdev)
        if (platp)
                port->uartclk = platp->uartclk;
        else {
-               ret = altera_uart_get_of_uartclk(pdev, port);
+               ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
+                                          &port->uartclk);
                if (ret)
                        return ret;
        }