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: 5177621 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0699DC11AD for ; Tue, 28 Oct 2014 14:38:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E6AA20122 for ; Tue, 28 Oct 2014 14:38:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30F3A200D6 for ; Tue, 28 Oct 2014 14:38:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753584AbaJ1OiW (ORCPT ); Tue, 28 Oct 2014 10:38:22 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:55900 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752390AbaJ1OiV (ORCPT ); Tue, 28 Oct 2014 10:38:21 -0400 Received: by mail-la0-f47.google.com with SMTP id pv20so737853lab.6 for ; Tue, 28 Oct 2014 07:38:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qhgzxYPewkZmn7btvnYYA6vlHrY0+eJCx9GNgST68cA=; b=CJcFAGNu9jklIlKk+CShif6R/nxbqHsHgNHy8pl7Hv0rwhajLls7d9ZM4H4iKwYZFd NvpPTKiO7asTpcQlFwSpBt0aRwu3FnF5mFK8nU4ggWZx0DubeHco+0UStV1PP4+jAt4L eCR7H37kZkS3QDUomqhalLD/nhSN3if6qPcrCbhgxWPb8hTK6MYOiB1Lv/JCY7HF3vlx gq6uycaWayxV+hN31fx0OnVdPxS2MUcv/TJcJLT01OenNdRQnk+J0mqrNeNZmUEwmzB4 6elNiosZWnxM36kZTZtcWYJGwALQxtK1kPpDoD+kqI4SrBc+exctrxfKG9CODjAQJ0v7 iyTw== X-Gm-Message-State: ALoCoQmwDbeqphYIjFPT548uxySRuQhWBycMmknZUHt653ugS0v05eXAyRY68r8j9xU1Er5tFMOi 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; };