Skip to content

Commit

Permalink
serial: sprd: check for NULL after calling devm_clk_get
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fernando Guzman Lugo authored and Greg Kroah-Hartman committed Jun 13, 2015
1 parent 899f0c1 commit ff0daa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/sprd_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ff0daa1

Please sign in to comment.