From patchwork Tue Oct 28 14:38:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 39669 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3544D24046 for ; Tue, 28 Oct 2014 14:38:22 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf541905lab.3 for ; Tue, 28 Oct 2014 07:38:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=qhgzxYPewkZmn7btvnYYA6vlHrY0+eJCx9GNgST68cA=; b=hBUtC4Towr8KGb/HBPB8hvm/z+8Jp58Zqlavh9lDydsNz7o2zhhYMVYUoFxbgPPZ4f +NuYbXn00TcAbwGmw4Hcxr2z9LCnFZi7VyFlo3fQfPe2N23+pYg/NhzZr23RQC2FWXFe Hz8gZeBLTYwsVWkdx2fkm8tkLAhdAGOUIDVTyzmKya6g2d6AvO0XtEOMjzaBCLHZfaiS 6k4TRPuYj+K3mQxEqDT8IU/W4KReCMHg6dFQvfhkQ6i7wFjVKfbc+/0JmI6HWp6TOu39 go1pqhCKeNlhquNMRbuHC3ueBq/yJYDpHMbsYz+8xjYzPbiELRrYjvrmiOetl9vuxWur arAw== X-Gm-Message-State: ALoCoQk0Y22xqZ3bln+6YRZdwXhLEG/aG5NNrQ6zyMxIu6EJ3JIJ/usIdxVlW2b/BNT9nx0Y+KvI X-Received: by 10.180.186.142 with SMTP id fk14mr5086515wic.4.1414507100995; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.133 with SMTP id m5ls65054laf.102.gmail; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) X-Received: by 10.152.42.172 with SMTP id p12mr4500240lal.11.1414507100816; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id m7si2810437lah.97.2014.10.28.07.38.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 07:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id w7so714231lbi.26 for ; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) X-Received: by 10.152.116.102 with SMTP id jv6mr4557440lab.40.1414507100587; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.84.229 with SMTP id c5csp492309lbz; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) X-Received: by 10.152.27.134 with SMTP id t6mr4461742lag.17.1414507100087; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id bc10si2899022lab.15.2014.10.28.07.38.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 07:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hz20so726391lab.39 for ; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) X-Received: by 10.112.147.225 with SMTP id tn1mr4472840lbb.37.1414507099973; Tue, 28 Oct 2014 07:38:19 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id qg4sm680886lbb.36.2014.10.28.07.38.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Oct 2014 07:38:19 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Alan Stern , Greg Kroah-Hartman , Tomasz Figa , Simon Horman , Magnus Damm , Ben Dooks , Kukjin Kim , Philipp Zabel , Mark Brown , Wolfram Sang , Russell King , Dmitry Torokhov , Jack Dai , Jinkun Hong , Aaron Lu , Sylwester Nawrocki , Ulf Hansson Subject: [PATCH 1/4] PM / Domains: Remove reference counting for the generic_pm_domain_data Date: Tue, 28 Oct 2014 15:38:07 +0100 Message-Id: <1414507090-516-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414507090-516-1-git-send-email-ulf.hansson@linaro.org> References: <1414507090-516-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The reference counting isn't needed, let's remove it. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 10 ++-------- include/linux/pm_domain.h | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 40bc2f4..7546242 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1430,7 +1430,6 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, gpd_data = gpd_data_new; dev->power.subsys_data->domain_data = &gpd_data->base; } - gpd_data->refcount++; if (td) gpd_data->td = *td; @@ -1478,7 +1477,6 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd, { struct generic_pm_domain_data *gpd_data; struct pm_domain_data *pdd; - bool remove = false; int ret = 0; dev_dbg(dev, "%s()\n", __func__); @@ -1507,10 +1505,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd, pdd = dev->power.subsys_data->domain_data; list_del_init(&pdd->list_node); gpd_data = to_gpd_data(pdd); - if (--gpd_data->refcount == 0) { - dev->power.subsys_data->domain_data = NULL; - remove = true; - } + dev->power.subsys_data->domain_data = NULL; spin_unlock_irq(&dev->power.lock); @@ -1521,8 +1516,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd, genpd_release_lock(genpd); dev_pm_put_subsys_data(dev); - if (remove) - __pm_genpd_free_dev_data(dev, gpd_data); + __pm_genpd_free_dev_data(dev, gpd_data); return 0; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 73e938b..e4edde1 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -103,7 +103,6 @@ struct generic_pm_domain_data { struct gpd_timing_data td; struct notifier_block nb; struct mutex lock; - unsigned int refcount; bool need_restore; };