From patchwork Fri Sep 21 06:26:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1489681 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4C59BDF28C for ; Fri, 21 Sep 2012 06:26:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754835Ab2IUG0i (ORCPT ); Fri, 21 Sep 2012 02:26:38 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:53748 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753601Ab2IUG0h (ORCPT ); Fri, 21 Sep 2012 02:26:37 -0400 Received: by qcro28 with SMTP id o28so2351911qcr.19 for ; Thu, 20 Sep 2012 23:26:37 -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=SL5zV8qcGynLdnveWz7zpmRErjebq/WCgx4PcI2SMlk=; b=P+Z8E+Q8g76deyExhixJGetxn9OrXg14L8OWytayGVI/qp6W92pSJZwheqbFbNJiUG ir36jUSMCXJNLcZqyzQbleIlSjidBJQcKbB6YcC7+OuEDeZSYGmB8N52YvelX6iu60Tw KttD8raF61P605IVY3a0635rej5DYvSOH1agamAz8tSPgn89hRiWv4oOpZkZL8wysRz1 rSDTXIl8qQY7GqVJpX/uz+tx3DwLN6Nem4tNrJQs8GqoD+yMFIFt2xDCX+uOkE5nSPwf sf01Qo838d+fyT2npQxdrmB/NFpinr3WOrMBxu/Ol78WmbgrDuhmRJZudwhp27fbu49J IU0Q== MIME-Version: 1.0 Received: by 10.224.179.7 with SMTP id bo7mr9974988qab.96.1348208797146; Thu, 20 Sep 2012 23:26:37 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 20 Sep 2012 23:26:37 -0700 (PDT) Date: Fri, 21 Sep 2012 14:26:37 +0800 Message-ID: Subject: [PATCH] ARM: OMAP: fix return value check in beagle_opp_init() From: Wei Yongjun To: tony@atomide.com, linux@arm.linux.org.uk Cc: yongjun_wei@trendmicro.com.cn, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Wei Yongjun In case of error, the function omap_device_get_by_hwmod_name() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Acked-by: Kevin Hilman --- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 6202fc7..a548d70 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -466,7 +466,7 @@ static void __init beagle_opp_init(void) mpu_dev = omap_device_get_by_hwmod_name("mpu"); iva_dev = omap_device_get_by_hwmod_name("iva"); - if (!mpu_dev || !iva_dev) { + if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", __func__, mpu_dev, iva_dev); return;