From patchwork Sat Jul 24 06:42:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 114051 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6O6grgH031094 for ; Sat, 24 Jul 2010 06:42:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752108Ab0GXGmr (ORCPT ); Sat, 24 Jul 2010 02:42:47 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:45099 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751907Ab0GXGmq (ORCPT ); Sat, 24 Jul 2010 02:42:46 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o6O6gfvv014579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Jul 2010 01:42:43 -0500 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o6O6gY9L026527; Sat, 24 Jul 2010 12:12:35 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id o6O6gYvW001453; Sat, 24 Jul 2010 12:12:34 +0530 Received: (from a0393109@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id o6O6gXZp001449; Sat, 24 Jul 2010 12:12:33 +0530 From: Thara Gopinath To: linux-omap@vger.kernel.org Cc: khilman@deeprootsystems.com, paul@pwsan.com, nm@ti.com, vishwanath.bs@ti.com, sawant@ti.com, Thara Gopinath Subject: [PM-OPP][PATCH] OMAP: Add check for omap_device pointer before adding an opp Date: Sat, 24 Jul 2010 12:12:33 +0530 Message-Id: <1279953753-1377-1-git-send-email-thara@ti.com> X-Mailer: git-send-email 1.5.6.6 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 24 Jul 2010 06:42:54 +0000 (UTC) diff --git a/arch/arm/plat-omap/opp.c b/arch/arm/plat-omap/opp.c index 0273497..e81bb95 100644 --- a/arch/arm/plat-omap/opp.c +++ b/arch/arm/plat-omap/opp.c @@ -333,7 +333,7 @@ int opp_add(const struct omap_opp_def *opp_def) return -EINVAL; } oh = omap_hwmod_lookup(opp_def->hwmod_name); - if (!oh) { + if (!oh || !oh->od) { pr_warn("%s: no hwmod for %s, cannot add OPPs.\n", __func__, opp_def->hwmod_name); return -EINVAL;