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: 43843 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 43CA423FFF for ; Tue, 27 Jan 2015 20:14:15 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf3692244wiv.0 for ; Tue, 27 Jan 2015 12:14:14 -0800 (PST) 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=9uWiiWNyVE2+o/HnbU6oFpYzrD8Bg6yz7rlYgz0h7a8=; b=hF5UdfU0wT/6Ey+tiVxq1B2eQAUy2VD/i47q7Nqb2gj/O7MuDgtO/pp36pBooT3vDx WxbaTAtRtysPc5Y9GAVS8hevIUrekGXC6a3sK9IU6WDtq2zvq9+xKS0OcyIsqP3NYXVw XLLRYehCmOg9g1jH7gyv65i735/vmPpSgW4g/cu5utpO+D+dSvTVfb1/85dVT9n6OHlO EYJDwri7te3oqDRUqKiLAjhq5n4kyWp5dPTMllZdTVyOyvjgRnnrNh3MZgUsSGVRfoCp Fn/JK0RETTYRDjHhFl+RPhN1n4G0LWGLL2vRtAiWBq3dzKcz4VFv+SJx+B0RHbXpPAYw zUBA== X-Gm-Message-State: ALoCoQlQdycQRkH5Xvq98aYe7S4Vc9GPQzbqelJ15wkVezybzd13OmMfPxrbgfmFKl8w358cWDrj X-Received: by 10.180.88.66 with SMTP id be2mr2887009wib.1.1422389654520; Tue, 27 Jan 2015 12:14:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.98 with SMTP id lf2ls77168lac.16.gmail; Tue, 27 Jan 2015 12:14:14 -0800 (PST) X-Received: by 10.152.4.233 with SMTP id n9mr3894863lan.61.1422389654367; Tue, 27 Jan 2015 12:14:14 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id 8si2256713lam.85.2015.01.27.12.14.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 12:14:14 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id ms9so15346076lab.1 for ; Tue, 27 Jan 2015 12:14:14 -0800 (PST) X-Received: by 10.112.180.135 with SMTP id do7mr3851240lbc.23.1422389654294; Tue, 27 Jan 2015 12:14:14 -0800 (PST) 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.35.133 with SMTP id h5csp1213774lbj; Tue, 27 Jan 2015 12:14:13 -0800 (PST) X-Received: by 10.152.5.132 with SMTP id s4mr3916456las.39.1422389648469; Tue, 27 Jan 2015 12:14:08 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id a3si2276301lae.58.2015.01.27.12.14.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 12:14:08 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id ms9so15345664lab.1 for ; Tue, 27 Jan 2015 12:14:08 -0800 (PST) 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> 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.215.42 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 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 --- 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; };