瀏覽代碼

tty: serial: bcm63xx: Add support for unnamed clock outputs from DT

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>
Kevin Cernekee 10 年之前
父節點
當前提交
048c1df7e2
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/tty/serial/bcm63xx_uart.c

+ 2 - 1
drivers/tty/serial/bcm63xx_uart.c

@@ -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;