From patchwork Wed Oct 30 05:23:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3113051 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 AA13D9F3E2 for ; Wed, 30 Oct 2013 05:24:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC472201F4 for ; Wed, 30 Oct 2013 05:23:59 +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 F1A65201E9 for ; Wed, 30 Oct 2013 05:23:58 +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 1VbOG3-0000zX-Ad; Wed, 30 Oct 2013 05:23:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbOG0-0006Cf-UI; Wed, 30 Oct 2013 05:23:52 +0000 Received: from mail-bk0-x233.google.com ([2a00:1450:4008:c01::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbOFv-0006Bm-Jq for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2013 05:23:50 +0000 Received: by mail-bk0-f51.google.com with SMTP id e11so274666bkh.10 for ; Tue, 29 Oct 2013 22:23:21 -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=cuFmJEfzWNTtLgwvdAyZaV+MCsTj/8+axPpAVUEyMpg=; b=T1UHJ9mGtfuX3Z2fEdlWxcFUgkiC3Z3nbUV9ALsjXu5/2mt42nMlupMXkhupCrwz5F 00jj//Aw9kAuZWAKfnx/IZjjSxJFKVZa+WfEhlgW8Y8kmrIzY8ViGTVy28NYSryOfeeZ Ej8Ta2Hlzcgt46zSC79f5gcFZ6xw1VfAtnu8AE5p713rq8pBAsDRfbeTO5sULxPXkJdQ B5CB2PYkFfK+JEzE/CBwlO5JlOQFxaytwu1V0FNZO0qC2a+F0qgv01dE+7MfmZckI4tJ qxhR0hK+x9pjGQZFtJB+ENLuYD4MF02W77YEszYSmCOTl8+Di6hEK84aJ/SKD9Zj8gE+ oZqg== MIME-Version: 1.0 X-Received: by 10.204.228.198 with SMTP id jf6mr20361bkb.41.1383110601307; Tue, 29 Oct 2013 22:23:21 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Tue, 29 Oct 2013 22:23:21 -0700 (PDT) Date: Wed, 30 Oct 2013 13:23:21 +0800 Message-ID: Subject: [PATCH] ARM: OMAP3: Beagle: fix return value check in beagle_opp_init() 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-20131030_012347_786891_80108850 X-CRM114-Status: GOOD ( 10.87 ) 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.6 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 get_cpu_device() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index a516c1b..d6ed819 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -510,7 +510,7 @@ static int __init beagle_opp_init(void) mpu_dev = get_cpu_device(0); iva_dev = omap_device_get_by_hwmod_name("iva"); - if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { + if (!mpu_dev || IS_ERR(iva_dev)) { pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", __func__, mpu_dev, iva_dev); return -ENODEV;