From patchwork Tue Jul 16 12:17:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2828102 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AE6C8C0AB2 for ; Tue, 16 Jul 2013 12:19:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7460D201B7 for ; Tue, 16 Jul 2013 12:19:10 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38DE0201B5 for ; Tue, 16 Jul 2013 12:19:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz4D5-0004bm-Cm; Tue, 16 Jul 2013 12:18:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz4Cx-0002Pb-Df; Tue, 16 Jul 2013 12:18:19 +0000 Received: from mail-bk0-x22e.google.com ([2a00:1450:4008:c01::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz4Cm-0002NX-4T for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2013 12:18:08 +0000 Received: by mail-bk0-f46.google.com with SMTP id na10so229603bkb.19 for ; Tue, 16 Jul 2013 05:17:46 -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=UHRqgfkqqb15/vvoVRCS+K2Rl8/okYwKX13vsMu1t80=; b=zzYG/f74cnobbUcOuGaATRXwkMArQvBfC+W3PvrWKK5Vdih9FQTRaluJvEojiMnh6M zeBToL/DxBt+/OZGq3NfxGv2yrs+E6+9Z6q1ewr3Smkp/f9LEfbktN1HxCcHZGQx9z16 QIE1Vbz4Lb8Kw16euWmME7CAF6IeB6vpAM18d2s7MyirTNgci9iTaNsnU+xzUpmlimdL dX9UhEdRR+PgMGEfFplPoNvHIlRNmlmcNCVr3I5NJR+iwBFGzrH1N8dYDOd9uyJZfKfn 56muUgWsvvk9FDQUhqZRZTfTDbVjwXUYRrWV3876b0vC2IRK/3n7fJ9QvYcKDNjLS2YN J2Hg== MIME-Version: 1.0 X-Received: by 10.204.236.136 with SMTP id kk8mr228248bkb.151.1373977066018; Tue, 16 Jul 2013 05:17:46 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Tue, 16 Jul 2013 05:17:45 -0700 (PDT) Date: Tue, 16 Jul 2013 20:17:45 +0800 Message-ID: Subject: [PATCH -next] clk: sunxi: fix return value check From: Wei Yongjun To: mturquette@linaro.org, emilio@elopez.com.ar, gregory.clement@free-electrons.com, maxime.ripard@free-electrons.com, cate@cateee.net X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130716_081808_325151_927B221B X-CRM114-Status: GOOD ( 10.66 ) X-Spam-Score: -2.0 (--) Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function clk_register_composite() and clk_register_factors() returns ERR_PTR() not NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- drivers/clk/sunxi/clk-sunxi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 412912b..02e440b 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -64,7 +64,7 @@ static void __init sunxi_osc_clk_setup(struct device_node *node) &gate->hw, &clk_gate_ops, CLK_IS_ROOT); - if (clk) { + if (!IS_ERR(clk)) { of_clk_add_provider(node, of_clk_src_simple_get, clk); clk_register_clkdev(clk, clk_name, NULL); } @@ -221,7 +221,7 @@ static void __init sunxi_factors_clk_setup(struct device_node *node, clk = clk_register_factors(NULL, clk_name, parent, 0, reg, data->table, data->getter, &clk_lock); - if (clk) { + if (!IS_ERR(clk)) { of_clk_add_provider(node, of_clk_src_simple_get, clk); clk_register_clkdev(clk, clk_name, NULL); }