Skip to contentSkip to conversation

OMAP: Add check for omap_device pointer before adding an opp

PATCH Superseded Thara Gopinath 2 participants 2 messages Jul 24, 2010 – Jul 27, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: Add check for omap_device pointer before adding an opp

This patch adds the check for whether a omap_device and in turn platform_device and device pointers exist for the device before adding it's opp table into the global table. This is because all the later accesses to the opp entries are based on dev pointer and hence there is no point in adding a opp if the dev pointer does not exist.

---
 arch/arm/plat-omap/opp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-omap/opp.c +1 -1
index 0273497..e81bb95 100644
@@ -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;
Signature · 1 line
1.7.0.rc1.33.g07cf0f
Acked-by on v1 1/1
#1 lore raw

Gopinath, Thara had written, on 07/24/2010 01:42 AM, the following:

Quoted 17 lines

This patch adds the check for whether a omap_device and in turn platform_device and device pointers exist for the device before adding it's opp table into the global table. This is because all the later accesses to the opp entries are based on dev pointer and hence there is no point in adding a opp if the dev pointer does not exist.

---
 arch/arm/plat-omap/opp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-omap/opp.c +0 -0
index 0273497..e81bb95 100644

arch/arm/plat-omap/opp.c int opp_add(const struct omap_opp_def *opp_def) · line 337

Quoted 6 lines
arch/arm/plat-omap/opp.c +1 -1
@@ -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",

just to continue to have sane warnings,

minor nitpick -> s/no hwmod/no hwmod or odev/

arch/arm/plat-omap/opp.c int opp_add(const struct omap_opp_def *opp_def) · line 339

Quoted 2 lines
arch/arm/plat-omap/opp.c +0 -0
 			__func__, opp_def->hwmod_name);
 		return -EINVAL;
Signature · 2 lines
Regards,
Nishanth Menon