From patchwork Fri Feb 22 02:52:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2174361 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 D24843FD4E for ; Fri, 22 Feb 2013 02:55:53 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U8ike-0004m7-ME; Fri, 22 Feb 2013 02:52:44 +0000 Received: from mail-bk0-f51.google.com ([209.85.214.51]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U8ikZ-0004la-EA for linux-arm-kernel@lists.infradead.org; Fri, 22 Feb 2013 02:52:41 +0000 Received: by mail-bk0-f51.google.com with SMTP id ik5so85701bkc.24 for ; Thu, 21 Feb 2013 18:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=VeAwUJiEE92RbRLCLSDAp27QNzSmWztLN8izvrR1TyM=; b=DL5rRRkzje3tjllAP1xcIiKIYR6hAg85phKN8nCEDKXNaxHzIXpHrRzKe0U23nx7iZ /hhIQXCxBRhS9aG1GderGsRpUcvJcO0ydaDk8Dy4AgZj/taWYdsVGQ17nCSAQSskN/5m e3oJZ+MHx1CI6ltXcwUGR2oXqgcH96JAIW7hgBVDCDbarkidjkysnBAlR2yHwNG5lAlz GMPkVgP5+G7CK+RAZUkKh9V2uh0a+10UsP+YDLe3ze/SXbdvBcjHwjvVolV2lmH4Jw5M jgThPxA1Mb9u4RmUA/0Nhgqf0qzeGfvMLt59mTL3PJ1dKqKmzxEhcvCjDyWuy6pWoZNn 8qJQ== MIME-Version: 1.0 X-Received: by 10.204.147.10 with SMTP id j10mr137872bkv.7.1361501555358; Thu, 21 Feb 2013 18:52:35 -0800 (PST) Received: by 10.204.30.210 with HTTP; Thu, 21 Feb 2013 18:52:35 -0800 (PST) Date: Fri, 22 Feb 2013 10:52:35 +0800 Message-ID: Subject: [PATCH -next] spi: fix return value check in ce4100_spi_probe() From: Wei Yongjun To: eric.y.miao@gmail.com, linux@arm.linux.org.uk, haojian.zhuang@gmail.com, grant.likely@secretlab.ca, broonie@opensource.wolfsonmicro.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130221_215239_594501_8E3501DB X-CRM114-Status: GOOD ( 11.63 ) 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.214.51 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: spi-devel-general@lists.sourceforge.net, 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 platform_device_register_full() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- drivers/spi/spi-pxa2xx-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c index 364964d..0a11dcfc 100644 --- a/drivers/spi/spi-pxa2xx-pci.c +++ b/drivers/spi/spi-pxa2xx-pci.c @@ -47,8 +47,8 @@ static int ce4100_spi_probe(struct pci_dev *dev, pi.size_data = sizeof(spi_pdata); pdev = platform_device_register_full(&pi); - if (!pdev) - return -ENOMEM; + if (IS_ERR(pdev)) + return PTR_ERR(pdev); pci_set_drvdata(dev, pdev);