summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2017-09-20 13:14:04 +0200
committerJames Hogan <jhogan@kernel.org>2017-11-07 18:33:18 +0000
commitfa1e6a8aec47d5623f8361907f57e44f112a8f4f (patch)
tree4ae6fe3bae3e94544aac57bee71ab7ab3492b9ac /drivers/tty
parent9a9cc02a6a558cf4d9ebeeda0832c5e2b8128f33 (diff)
downloadop-kernel-dev-fa1e6a8aec47d5623f8361907f57e44f112a8f4f.zip
op-kernel-dev-fa1e6a8aec47d5623f8361907f57e44f112a8f4f.tar.gz
tty/bcm63xx_uart: allow naming clock in device tree
Codify using a named clock for the refclk of the uart. This makes it easier if we might need to add a gating clock (like present on the BCM6345). Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Russell King <linux@armlinux.org.uk> Cc: linux-mips@linux-mips.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-serial@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com Patchwork: https://patchwork.linux-mips.org/patch/17328/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: James Hogan <jhogan@kernel.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/bcm63xx_uart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index afcc041..0385bd3 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -846,8 +846,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
if (!res_irq)
return -ENODEV;
- clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
- clk_get(&pdev->dev, "refclk");
+ clk = clk_get(&pdev->dev, "refclk");
+ if (IS_ERR(clk) && pdev->dev.of_node)
+ clk = of_clk_get(pdev->dev.of_node, 0);
+
if (IS_ERR(clk))
return -ENODEV;
OpenPOWER on IntegriCloud