From patchwork Tue May 4 00:34:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Chan X-Patchwork-Id: 96643 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o440YdYI018578 for ; Tue, 4 May 2010 00:34:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754802Ab0EDAei (ORCPT ); Mon, 3 May 2010 20:34:38 -0400 Received: from smtp-out.google.com ([216.239.44.51]:40762 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753413Ab0EDAeg (ORCPT ); Mon, 3 May 2010 20:34:36 -0400 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id o440YYgZ006834; Mon, 3 May 2010 17:34:34 -0700 Received: from mikechan.mtv.corp.google.com (mikechan.mtv.corp.google.com [172.18.102.252]) by wpaz5.hot.corp.google.com with ESMTP id o440YXE3024551; Mon, 3 May 2010 17:34:33 -0700 Received: by mikechan.mtv.corp.google.com (Postfix, from userid 18922) id 04311223B7; Mon, 3 May 2010 17:34:32 -0700 (PDT) From: Mike Chan Cc: khilman@deeprootsystems.com, linux-omap@vger.kernel.org, Mike Chan Subject: [PATCH 2/2] [ARM] omap-pm: resource: Only update resource level if there is a change Date: Mon, 3 May 2010 17:34:31 -0700 Message-Id: <1272933271-12937-2-git-send-email-mike@android.com> X-Mailer: git-send-email 1.7.0.1 In-Reply-To: <1272933271-12937-1-git-send-email-mike@android.com> References: <1272933271-12937-1-git-send-email-mike@android.com> X-System-Of-Record: true To: unlisted-recipients:; (no To-header on input) 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]); Tue, 04 May 2010 00:34:40 +0000 (UTC) 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);