From patchwork Tue Jan 27 20:13:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5720011 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A9BEF9F50F for ; Tue, 27 Jan 2015 20:14:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D70912024D for ; Tue, 27 Jan 2015 20:14:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E3B320256 for ; Tue, 27 Jan 2015 20:14:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759522AbbA0UOK (ORCPT ); Tue, 27 Jan 2015 15:14:10 -0500 Received: from mail-lb0-f171.google.com ([209.85.217.171]:37444 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759589AbbA0UOJ (ORCPT ); Tue, 27 Jan 2015 15:14:09 -0500 Received: by mail-lb0-f171.google.com with SMTP id u14so15035982lbd.2 for ; Tue, 27 Jan 2015 12:14:08 -0800 (PST) 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=9uWiiWNyVE2+o/HnbU6oFpYzrD8Bg6yz7rlYgz0h7a8=; b=OCaD6z/pzyPRIQPMWY5UL/dMSnIcCgfuhG5+0hci8rV/IEfubLNIz4e3x+lAoZi5jz 7Vt/n/B/CBtIJqAHxKoyAOaaBRsidPqFvs4Q8lb+5QQY+9JG5xZTN+GoSjC+vI35kMhA ZNAzJcZtRD1F1hEac98l9RRxzsgYPseBrWvJbGF2I7hdxLd+wghMu/GoDJUV1SsmcMX4 28ppVeF3zkh+44DogVL5YjG6EGh/wt/YaRVX2gid6qW31LAFGpIiai3faUEh4Fu75ZwP 9KKoIWg5O06Y+cCz/Sc8PU/O4EtxEdzKUVBZh97iJXijy8LPYNNJfGJ5E6QqllFWsbce azfA== X-Gm-Message-State: ALoCoQnuMpQMfopFdXfoTd9xeHhWjw02S4GYiriqXMKgWPh4rrSnPhn5r9GwJp9m7Pck1xCcerQU X-Received: by 10.112.162.167 with SMTP id yb7mr4044435lbb.76.1422389648358; Tue, 27 Jan 2015 12:14:08 -0800 (PST) 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 ya4sm713470lbb.32.2015.01.27.12.14.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jan 2015 12:14:07 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Kevin Hilman , linux-pm@vger.kernel.org Cc: Geert Uytterhoeven , Dmitry Torokhov , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Ulf Hansson Subject: [PATCH 2/8] PM / Domains: Remove reference counting for the generic_pm_domain_data Date: Tue, 27 Jan 2015 21:13:39 +0100 Message-Id: <1422389625-11730-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422389625-11730-1-git-send-email-ulf.hansson@linaro.org> References: <1422389625-11730-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 was needed when genpd supported PM domain device callbacks. Since this option has been removed, let's also remove the reference counting of the struct generic_pm_domain_data. Signed-off-by: Ulf Hansson Acked-by: Pavel Machek --- 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 f9e7df5..351df5b 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1456,7 +1456,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; @@ -1504,7 +1503,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__); @@ -1533,10 +1531,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); @@ -1547,8 +1542,7 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd, genpd_release_lock(genpd); dev_pm_put_subsys_data(dev); - if (remove) - genpd_free_dev_data(dev, gpd_data); + genpd_free_dev_data(dev, gpd_data); return 0; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index ed60776..e160a0b 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -114,7 +114,6 @@ struct generic_pm_domain_data { struct gpd_timing_data td; struct notifier_block nb; struct mutex lock; - unsigned int refcount; int need_restore; };