From patchwork Sun Oct 7 14:02:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1561341 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 987133FD9C for ; Sun, 7 Oct 2012 14:04:16 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TKrRM-0002xs-Tm; Sun, 07 Oct 2012 14:02:45 +0000 Received: from mail-qc0-f172.google.com ([209.85.216.172]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TKrRI-0002wj-M4; Sun, 07 Oct 2012 14:02:41 +0000 Received: by mail-qc0-f172.google.com with SMTP id c10so2704769qca.17 for ; Sun, 07 Oct 2012 07:02:40 -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=Nr01tA07uRyPhuE5Gu4fJrooNlrizfjAagIMTU4fdJw=; b=cVsVIMg6eK0T3gsjI8Jy5DncOgzGoFIoxN830yzT8wAfzs58offFj+Gny8rPz0A4KC zs24it1unkG4i/Dk8KxWv3zVkQ30epJMiBCrbw8hdQtETrU3PX9hZofX9f8Hnl9e2xLG NrfBOi8UWfGZ4RB6yF/mKuPICsisz/lCzYGjCOgTkGFYjcZlOa2GC7mf1+uZnDk3VcfE VORYH2P2+Fh+VX9xTPurCotSZP4ZEK1VagyZl5pO0ZUh9gZAkKbgzFKLSYC0f+qEA/6n 9faCLgFEgoQL0YdB2LL6V85xdSNq8kQU7SO77VPO2q1vT65R32zQr5QPQQXpX6f0iWYB e2pw== MIME-Version: 1.0 Received: by 10.49.4.65 with SMTP id i1mr36829024qei.51.1349618560039; Sun, 07 Oct 2012 07:02:40 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Sun, 7 Oct 2012 07:02:40 -0700 (PDT) Date: Sun, 7 Oct 2012 22:02:40 +0800 Message-ID: Subject: [PATCH] clk: fix return value check in bcm2835_init_clocks() From: Wei Yongjun To: mturquette@ti.com, swarren@wwwdotorg.org 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.172 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-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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() 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 Acked-by: Stephen Warren --- drivers/clk/clk-bcm2835.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk-bcm2835.c b/drivers/clk/clk-bcm2835.c index 67ad16b..b61ee2c 100644 --- a/drivers/clk/clk-bcm2835.c +++ b/drivers/clk/clk-bcm2835.c @@ -33,17 +33,17 @@ void __init bcm2835_init_clocks(void) clk = clk_register_fixed_rate(NULL, "sys_pclk", NULL, CLK_IS_ROOT, 250000000); - if (!clk) + if (IS_ERR(clk)) pr_err("sys_pclk not registered\n"); clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 126000000); - if (!clk) + if (IS_ERR(clk)) pr_err("apb_pclk not registered\n"); clk = clk_register_fixed_rate(NULL, "uart0_pclk", NULL, CLK_IS_ROOT, 3000000); - if (!clk) + if (IS_ERR(clk)) pr_err("uart0_pclk not registered\n"); ret = clk_register_clkdev(clk, NULL, "20201000.uart"); if (ret) @@ -51,7 +51,7 @@ void __init bcm2835_init_clocks(void) clk = clk_register_fixed_rate(NULL, "uart1_pclk", NULL, CLK_IS_ROOT, 125000000); - if (!clk) + if (IS_ERR(clk)) pr_err("uart1_pclk not registered\n"); ret = clk_register_clkdev(clk, NULL, "20215000.uart"); if (ret)