From patchwork Fri Sep 21 06:35:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1489781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 5A5FE3FCFC for ; Fri, 21 Sep 2012 06:37:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEwpg-0004el-3q; Fri, 21 Sep 2012 06:35:24 +0000 Received: from mail-qa0-f42.google.com ([209.85.216.42]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TEwpb-0004dI-1y for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2012 06:35:19 +0000 Received: by qaeb19 with SMTP id b19so996676qae.15 for ; Thu, 20 Sep 2012 23:35:18 -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=ew6LMXMht5nU3HaoJmWFzCTVHmU8XCNxYVX79+fLdks=; b=nH6/UJLWj9nOdmBL+e/iCrCCrOik7McDe76LqTslK/LbaY5USx/a9Zla/6++qIrRcm uDQjZxgdF93sUATXiUAijm191Sp3HcJv3B+WG2vOUyOC6bPmJBXTO8VKGs2LG0rwaXXt x+XYHgmJ0o0sgxcvXdJAbDPn+r7rjXCBtHwwo4AlYYkniYzpu/W5YpiOvXhO0RReCrA0 1eqDqtwpalRlctd5aAx3/C852pfZw+HHL0TiLvQ1fRK2qS7B7qrJYep6FTrAVqVKcpsZ 3bAU6toN67r9Q+gKNIGDlGlKTk1f/2hGpYc4DuduSt8qzxWgaQjzWpSE432KigMGqQ0T A0CA== MIME-Version: 1.0 Received: by 10.224.184.20 with SMTP id ci20mr10280964qab.26.1348209318234; Thu, 20 Sep 2012 23:35:18 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 20 Sep 2012 23:35:18 -0700 (PDT) Date: Fri, 21 Sep 2012 14:35:18 +0800 Message-ID: Subject: [PATCH] clk: fix return value check in of_fixed_clk_setup() From: Wei Yongjun To: mturquette@ti.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.216.42 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (weiyj.lk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Wei Yongjun In case of error, the function clk_register_fixed_rate() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- drivers/clk/clk-fixed-rate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c index f5ec0ee..af78ed6 100644 --- a/drivers/clk/clk-fixed-rate.c +++ b/drivers/clk/clk-fixed-rate.c @@ -97,7 +97,7 @@ void __init of_fixed_clk_setup(struct device_node *node) of_property_read_string(node, "clock-output-names", &clk_name); clk = clk_register_fixed_rate(NULL, clk_name, NULL, CLK_IS_ROOT, rate); - if (clk) + if (!IS_ERR(clk)) of_clk_add_provider(node, of_clk_src_simple_get, clk); } EXPORT_SYMBOL_GPL(of_fixed_clk_setup);