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: 5720001 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 D1CCC9F2ED for ; Tue, 27 Jan 2015 20:14:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0200A2024D 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 22EBF20254 for ; Tue, 27 Jan 2015 20:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759590AbbA0UOK (ORCPT ); Tue, 27 Jan 2015 15:14:10 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:64571 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754100AbbA0UOJ (ORCPT ); Tue, 27 Jan 2015 15:14:09 -0500 Received: by mail-lb0-f179.google.com with SMTP id 10so15056182lbg.10 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=mDq8qqdwnR7M9BAFScZ6dDrTijwH+Jrg91zhDhxaJlxZ2FeNzwnftOR9AVkZMDPbvF Fzt94yK1ZZzue0h8vB9KtALVYktrMPn352tvwZT3RNP2CAyk6Xm7O60PEOFBLNtfI+g7 3rWjy6VBQJPD49pM0u09kYLQMoNzSq25iPMJbQLPKUiU3X0pojZ5aqSkIr3qflkwuhTM DwyDF8nfBpX3Ocwy059t1SIo3JXf1u2gm8gKp5J+gly3RY4IGob4pSdleCjc75q4M7Q2 pFdGQhDQuPY+eWFHR18yABZVHDylBJbL/ang7ZKp72A71/4uFxdZRByX0eKfYYdSUrw9 eueQ== X-Gm-Message-State: ALoCoQmeUzR7A2mLMtXezRoO19h6t5zqyyd4RbqMBs1o43MWmz08/M0fXWCvYd7jx+OpfwaxlrDi 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-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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; };