tty: serial: bcm63xx: Add support for unnamed clock outputs from DT
authorKevin Cernekee <cernekee@gmail.com>
Tue, 21 Oct 2014 22:22:58 +0000 (15:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Nov 2014 22:57:23 +0000 (14:57 -0800)
The original non-DT bcm63xx clk code ignores the struct device argument
and looks up a global clock name.  DT platforms, by contrast, often just
use a phandle to reference a clock node with no "clock-output-names"
property.  Modify the UART driver to support both schemes.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/bcm63xx_uart.c

index 2315190..de95573 100644 (file)
@@ -824,7 +824,8 @@ static int bcm_uart_probe(struct platform_device *pdev)
        if (!res_irq)
                return -ENODEV;
 
-       clk = clk_get(&pdev->dev, "periph");
+       clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
+                                 clk_get(&pdev->dev, "periph");
        if (IS_ERR(clk))
                return -ENODEV;