diff mbox

[PM-OPP,PATCHV2] OMAP: Add check for omap_device pointer before adding an opp

Message ID 1280737281-22967-1-git-send-email-thara@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thara Gopinath Aug. 2, 2010, 8:21 a.m. UTC
None
diff mbox

Patch

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;
 	}