From patchwork Sun Oct 7 13:58:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1561281 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 72F33DFF71 for ; Sun, 7 Oct 2012 13:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752499Ab2JGN64 (ORCPT ); Sun, 7 Oct 2012 09:58:56 -0400 Received: from mail-qc0-f180.google.com ([209.85.216.180]:63983 "EHLO mail-qc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760Ab2JGN6z (ORCPT ); Sun, 7 Oct 2012 09:58:55 -0400 Received: by mail-qc0-f180.google.com with SMTP id v28so2212847qcm.11 for ; Sun, 07 Oct 2012 06:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=WvNfqJYRwzjRqKjAcHqzoF2D7xAAByl3oL3psQKUZho=; b=0eEhq4AE4VZr/KTwjO2zQrt79pCZDwR7iHzZSxO9Gs962bn2yHtYFnlMTyL5R61Z48 dq0zt78rdQRhNS6i4sGC4g1DxXzX/vDcikQuqFMLNOtFEvw3i7Lfzj61+YDdCmPsgSrW 3aG9ETG4EZF0Nmyf6/UOxOyIswxUKjJz85x+g35Q3P6S4Pr9rDIF7fMDDrx2em1Ntm34 vIS7zwMLoyFzeaFLKleRqB8TYq3dP76q/NiWaHc9IkQFDpMG6ojxh9G5sj/vzlPwir1m LnUcGe7Ndfq+7wsd/93njlqHCBxxDnkKdhXUqgT/HFm/I0v1FvBE8KyhD10oL3H3eZUn Hplw== MIME-Version: 1.0 Received: by 10.49.14.228 with SMTP id s4mr36879235qec.4.1349618335215; Sun, 07 Oct 2012 06:58:55 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Sun, 7 Oct 2012 06:58:55 -0700 (PDT) Date: Sun, 7 Oct 2012 21:58:55 +0800 Message-ID: Subject: [PATCH] ARM: OMAP: fix return value check in realtime_counter_init() From: Wei Yongjun To: tony@atomide.com, linux@arm.linux.org.uk Cc: yongjun_wei@trendmicro.com.cn, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Wei Yongjun In case of error, the function clk_get() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- arch/arm/mach-omap2/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 8847d6e..44f9aa7 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -378,7 +378,7 @@ static void __init realtime_counter_init(void) return; } sys_clk = clk_get(NULL, "sys_clkin_ck"); - if (!sys_clk) { + if (IS_ERR(sys_clk)) { pr_err("%s: failed to get system clock handle\n", __func__); iounmap(base); return;