From patchwork Thu Jul 4 13:42:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2823741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 18E869F9D2 for ; Thu, 4 Jul 2013 13:43:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA7CB2018A for ; Thu, 4 Jul 2013 13:43:09 +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 B494420187 for ; Thu, 4 Jul 2013 13:43:08 +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 1UujoO-0004uD-Aj; Thu, 04 Jul 2013 13:43:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UujoL-0000GB-H6; Thu, 04 Jul 2013 13:43:01 +0000 Received: from mail-bk0-x22a.google.com ([2a00:1450:4008:c01::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UujoH-0000FG-Ur for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2013 13:42:58 +0000 Received: by mail-bk0-f42.google.com with SMTP id jk13so667248bkc.29 for ; Thu, 04 Jul 2013 06:42:35 -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=ES3USFa3mWQiDkOCW0X54OmHrNp9RYgD3OBZQGiVF3Y=; b=tkL8/xhc3WIEXA797oH2ygaqMlxzq8IzfxRPp+6bWlpgSubd5u3Tn1LvExUKfEgwWI 2CldESxNL3OcG+xUPxCJ0CHlgRqRZWp4AJM6e/LHt/iCeA2yTClRFKj6va3YQWjeYlQ/ 28f2BmsHYmSzQRzh6gUgv7/ANz2xO/rb6oGuGmVTWHnL+A7V5LKDMEO2/CQJgXcqJI2M jqjl2//ShgfY5crg77ayR0e3w1Gp8bA0wEQWp5rrYw5b+FPJJEOWbhkFt5Gg18tI3x5a RHHFUxkCtZBAg6845ppVG1ZakUpt7l+jIl7Fhe3aM96nOU2C6YXKWD/FEAQ9J9A1q6Ou gIew== MIME-Version: 1.0 X-Received: by 10.204.224.77 with SMTP id in13mr1121221bkb.24.1372945354975; Thu, 04 Jul 2013 06:42:34 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Thu, 4 Jul 2013 06:42:34 -0700 (PDT) Date: Thu, 4 Jul 2013 21:42:34 +0800 Message-ID: Subject: [PATCH] ARM: OMAP: fix return value check in omap_device_build_from_dt() From: Wei Yongjun To: tony@atomide.com, linux@arm.linux.org.uk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130704_094258_163075_A0DF0665 X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -2.0 (--) Cc: yongjun_wei@trendmicro.com.cn, linux-omap@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.3 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 omap_device_alloc() 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 Acked-by: Kevin Hilman --- arch/arm/mach-omap2/omap_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 5cc9287..28e70c0 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -155,7 +155,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev) } od = omap_device_alloc(pdev, hwmods, oh_cnt); - if (!od) { + if (IS_ERR(od)) { dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n", oh_name); ret = PTR_ERR(od);