From patchwork Mon Aug 2 08:21:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 116453 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 o728KHbE022966 for ; Mon, 2 Aug 2010 08:21:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753508Ab0HBIVd (ORCPT ); Mon, 2 Aug 2010 04:21:33 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:58703 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753491Ab0HBIVd (ORCPT ); Mon, 2 Aug 2010 04:21:33 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o728LSBn025724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Aug 2010 03:21:30 -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 o728LMGh020530; Mon, 2 Aug 2010 13:51:23 +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 o728LMrV023037; Mon, 2 Aug 2010 13:51:22 +0530 Received: (from a0393109@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id o728LLp9023035; Mon, 2 Aug 2010 13:51:21 +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][PATCHV2] OMAP: Add check for omap_device pointer before adding an opp Date: Mon, 2 Aug 2010 13:51:21 +0530 Message-Id: <1280737281-22967-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]); Mon, 02 Aug 2010 08:21:34 +0000 (UTC) diff --git a/arch/arm/plat-omap/opp.c b/arch/arm/plat-omap/opp.c index 0273497..f3855ba 100644 --- a/arch/arm/plat-omap/opp.c +++ b/arch/arm/plat-omap/opp.c @@ -333,8 +333,8 @@ int opp_add(const struct omap_opp_def *opp_def) return -EINVAL; } oh = omap_hwmod_lookup(opp_def->hwmod_name); - if (!oh) { - pr_warn("%s: no hwmod for %s, cannot add OPPs.\n", + if (!oh || !oh->od) { + pr_warn("%s: no hwmod or odev for %s, cannot add OPPs.\n", __func__, opp_def->hwmod_name); return -EINVAL; }