From patchwork Thu Nov 1 05:33: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: 1683101 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 D78AC3FD4E for ; Thu, 1 Nov 2012 05:36:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TTnPq-0004bA-Dl; Thu, 01 Nov 2012 05:34:06 +0000 Received: from mail-qa0-f49.google.com ([209.85.216.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TTnPk-0004am-L0 for linux-arm-kernel@lists.infradead.org; Thu, 01 Nov 2012 05:34:03 +0000 Received: by mail-qa0-f49.google.com with SMTP id a17so31541qae.15 for ; Wed, 31 Oct 2012 22:33:56 -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=4TcDTJ6xG4x1krhTkxeSBk9oXSWHx+jLYCJ0JmGFmrk=; b=VuWyK49xAqpl4posgvW6+wQvP5M9bUM5KHXSxOC+PYR2FoSDaoxrH3VeaINT8qe2CF Pp7W8fEqVu3uTtVLH5z+lHv6sDMpd0tf5JHhZG73cFwFfNUiQBQIrGvwEH2wtlS/0rWV zMHOPb7TBm+OlJFs6ZoyV//2RBquxNVmEiC5VzfKxDMtXH0V7JRnEXKCZS/DY7ssVT56 /wZIEjwWhRxj2/lAmoCyZhC1Xs9ItPUfIx47i8+cO9VnKfVtOAbij619kYv7AFdpQI6C 2IVa0hBmV12pYy4Zgc7UslHE9jtgpIebVIz4vzaJMcCTFWBYaZ/kQNriBsenHzIEnipl 7pPA== MIME-Version: 1.0 Received: by 10.49.60.231 with SMTP id k7mr31729007qer.25.1351748035966; Wed, 31 Oct 2012 22:33:55 -0700 (PDT) Received: by 10.229.207.197 with HTTP; Wed, 31 Oct 2012 22:33:55 -0700 (PDT) Date: Thu, 1 Nov 2012 13:33:55 +0800 Message-ID: Subject: [PATCH -next] CLK: clk-twl6040: fix return value check in twl6040_clk_probe() From: Wei Yongjun To: mturquette@ti.com, peter.ujfalusi@ti.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121101_013400_917632_B10455DB X-CRM114-Status: GOOD ( 13.95 ) 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.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (weiyj.lk[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.216.49 listed in list.dnswl.org] -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() 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 --- drivers/clk/clk-twl6040.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index f4a3389..bc1e713 100644 --- a/drivers/clk/clk-twl6040.c +++ b/drivers/clk/clk-twl6040.c @@ -92,8 +92,8 @@ static int __devinit twl6040_clk_probe(struct platform_device *pdev) clkdata->mcpdm_fclk.init = &wm831x_clkout_init; clkdata->clk = clk_register(&pdev->dev, &clkdata->mcpdm_fclk); - if (!clkdata->clk) - return -EINVAL; + if (IS_ERR(clkdata->clk)) + return PTR_ERR(clkdata->clk); dev_set_drvdata(&pdev->dev, clkdata);