]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: sprd: check for NULL after calling devm_clk_get
authorFernando Guzman Lugo <fernando.guzman.lugo@intel.com>
Thu, 11 Jun 2015 02:39:46 +0000 (10:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jun 2015 00:39:50 +0000 (17:39 -0700)
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 <fernando.guzman.lugo@intel.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sprd_serial.c

index 582d2729f7008078064da5ddec8bc456b5102003..3866516c2926a32c5f63600b7dbee05497af99bf 100644 (file)
@@ -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);