diff mbox

[2/2,ARM] omap-pm: resource: Only update resource level if there is a change

Message ID 1272933271-12937-2-git-send-email-mike@android.com (mailing list archive)
State New, archived
Delegated to: Kevin Hilman
Headers show

Commit Message

Mike Chan May 4, 2010, 12:34 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/resource.c b/arch/arm/plat-omap/resource.c
index 6d3bba6..ff5a938 100644
--- a/arch/arm/plat-omap/resource.c
+++ b/arch/arm/plat-omap/resource.c
@@ -104,7 +104,7 @@  static int update_resource_level(struct shared_resource *resp)
 {
 	struct users_list *user;
 	unsigned long target_level;
-	int ret;
+	int ret = 0;
 
 	mutex_lock(&resp->resource_mutex);
 	/* Regenerate the target_value for the resource */
@@ -125,6 +125,9 @@  static int update_resource_level(struct shared_resource *resp)
 	}
 	mutex_unlock(&resp->resource_mutex);
 
+	if (resp->curr_level == target_level)
+		return ret;
+
 	pr_debug("SRF: Changing Level for resource %s to %ld\n",
 				resp->name, target_level);
 	ret = resp->ops->change_level(resp, target_level);