forked from luck/tmp_suning_uos_patched
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 <fernando.guzman.lugo@intel.com> Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
899f0c1c7d
commit
ff0daa1c1a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user