From ff0daa1c1a28c9866d735852a1cbfb9c757aaa7b Mon Sep 17 00:00:00 2001 From: Fernando Guzman Lugo Date: Thu, 11 Jun 2015 10:39:46 +0800 Subject: serial: sprd: check for NULL after calling devm_clk_get In platforms which does not use CLK framework (HAVE_CLK not set), the clk_* functions return NULL instead of an error. This patch handles that scenario. Signed-off-by: Fernando Guzman Lugo Signed-off-by: Chunyan Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sprd_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 582d272..3866516 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -716,7 +716,7 @@ static int sprd_probe(struct platform_device *pdev) up->flags = UPF_BOOT_AUTOCONF; clk = devm_clk_get(&pdev->dev, NULL); - if (!IS_ERR(clk)) + if (!IS_ERR_OR_NULL(clk)) up->uartclk = clk_get_rate(clk); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- cgit v1.1