Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752072AbbFKCoM (ORCPT ); Wed, 10 Jun 2015 22:44:12 -0400 Received: from sci-ig2.spreadtrum.com ([222.66.158.135]:16337 "EHLO SHSQR01.spreadtrum.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751639AbbFKCoJ (ORCPT ); Wed, 10 Jun 2015 22:44:09 -0400 From: Chunyan Zhang To: CC: , , , , Subject: [PATCH] serial: sprd: check for NULL after calling devm_clk_get Date: Thu, 11 Jun 2015 10:39:46 +0800 Message-ID: <1433990386-14722-1-git-send-email-chunyan.zhang@spreadtrum.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MAIL: SHSQR01.spreadtrum.com t5B2eXkR070073 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 33 From: Fernando Guzman Lugo 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 --- drivers/tty/serial/sprd_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/