linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ulf.hansson@linaro.org (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/15] PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
Date: Wed,  3 Sep 2014 12:52:17 +0200	[thread overview]
Message-ID: <1409741551-16437-2-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1409741551-16437-1-git-send-email-ulf.hansson@linaro.org>

There are no users of these APIs. To simplify the generic power domain
let's remove them.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c | 106 --------------------------------------------
 include/linux/pm_domain.h   |  19 --------
 2 files changed, 125 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index eee55c1..e613e3c 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1744,112 +1744,6 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 }
 
 /**
- * pm_genpd_add_callbacks - Add PM domain callbacks to a given device.
- * @dev: Device to add the callbacks to.
- * @ops: Set of callbacks to add.
- * @td: Timing data to add to the device along with the callbacks (optional).
- *
- * Every call to this routine should be balanced with a call to
- * __pm_genpd_remove_callbacks() and they must not be nested.
- */
-int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops,
-			   struct gpd_timing_data *td)
-{
-	struct generic_pm_domain_data *gpd_data_new, *gpd_data = NULL;
-	int ret = 0;
-
-	if (!(dev && ops))
-		return -EINVAL;
-
-	gpd_data_new = __pm_genpd_alloc_dev_data(dev);
-	if (!gpd_data_new)
-		return -ENOMEM;
-
-	pm_runtime_disable(dev);
-	device_pm_lock();
-
-	ret = dev_pm_get_subsys_data(dev);
-	if (ret)
-		goto out;
-
-	spin_lock_irq(&dev->power.lock);
-
-	if (dev->power.subsys_data->domain_data) {
-		gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
-	} else {
-		gpd_data = gpd_data_new;
-		dev->power.subsys_data->domain_data = &gpd_data->base;
-	}
-	gpd_data->refcount++;
-	gpd_data->ops = *ops;
-	if (td)
-		gpd_data->td = *td;
-
-	spin_unlock_irq(&dev->power.lock);
-
- out:
-	device_pm_unlock();
-	pm_runtime_enable(dev);
-
-	if (gpd_data != gpd_data_new)
-		__pm_genpd_free_dev_data(dev, gpd_data_new);
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(pm_genpd_add_callbacks);
-
-/**
- * __pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device.
- * @dev: Device to remove the callbacks from.
- * @clear_td: If set, clear the device's timing data too.
- *
- * This routine can only be called after pm_genpd_add_callbacks().
- */
-int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
-{
-	struct generic_pm_domain_data *gpd_data = NULL;
-	bool remove = false;
-	int ret = 0;
-
-	if (!(dev && dev->power.subsys_data))
-		return -EINVAL;
-
-	pm_runtime_disable(dev);
-	device_pm_lock();
-
-	spin_lock_irq(&dev->power.lock);
-
-	if (dev->power.subsys_data->domain_data) {
-		gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
-		gpd_data->ops = (struct gpd_dev_ops){ NULL };
-		if (clear_td)
-			gpd_data->td = (struct gpd_timing_data){ 0 };
-
-		if (--gpd_data->refcount == 0) {
-			dev->power.subsys_data->domain_data = NULL;
-			remove = true;
-		}
-	} else {
-		ret = -EINVAL;
-	}
-
-	spin_unlock_irq(&dev->power.lock);
-
-	device_pm_unlock();
-	pm_runtime_enable(dev);
-
-	if (ret)
-		return ret;
-
-	dev_pm_put_subsys_data(dev);
-	if (remove)
-		__pm_genpd_free_dev_data(dev, gpd_data);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(__pm_genpd_remove_callbacks);
-
-/**
  * pm_genpd_attach_cpuidle - Connect the given PM domain with cpuidle.
  * @genpd: PM domain to be connected with cpuidle.
  * @state: cpuidle state this domain can disable/enable.
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 7c1d252..0aa9ad9 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -151,10 +151,6 @@ extern int pm_genpd_add_subdomain_names(const char *master_name,
 					const char *subdomain_name);
 extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 				     struct generic_pm_domain *target);
-extern int pm_genpd_add_callbacks(struct device *dev,
-				  struct gpd_dev_ops *ops,
-				  struct gpd_timing_data *td);
-extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
 extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
 extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
 extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
@@ -217,16 +213,6 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 {
 	return -ENOSYS;
 }
-static inline int pm_genpd_add_callbacks(struct device *dev,
-					 struct gpd_dev_ops *ops,
-					 struct gpd_timing_data *td)
-{
-	return -ENOSYS;
-}
-static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
-{
-	return -ENOSYS;
-}
 static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
 {
 	return -ENOSYS;
@@ -281,11 +267,6 @@ static inline int pm_genpd_name_add_device(const char *domain_name,
 	return __pm_genpd_name_add_device(domain_name, dev, NULL);
 }
 
-static inline int pm_genpd_remove_callbacks(struct device *dev)
-{
-	return __pm_genpd_remove_callbacks(dev, true);
-}
-
 #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
 extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
 extern void pm_genpd_poweroff_unused(void);
-- 
1.9.1

  reply	other threads:[~2014-09-03 10:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 10:52 [PATCH 00/15] PM / Domains: Cleanups and remove superfluous APIs Ulf Hansson
2014-09-03 10:52 ` Ulf Hansson [this message]
2014-09-03 10:52 ` [PATCH 02/15] PM / Domains: Ignore callbacks for subsys generic_pm_domain_data Ulf Hansson
2014-09-03 10:52 ` [PATCH 03/15] PM / Domains: Remove system PM callbacks from gpd_dev_ops Ulf Hansson
2014-09-03 10:52 ` [PATCH 04/15] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config Ulf Hansson
2014-09-03 10:52 ` [PATCH 05/15] ARM: shmobile: Drop dev_irq_safe from R-mobile " Ulf Hansson
2014-09-03 10:52 ` [PATCH 06/15] PM / Domains: Remove dev_irq_safe from " Ulf Hansson
2014-09-03 10:52 ` [PATCH 07/15] PM / Domains: Remove redundant check for CONFIG_PM Ulf Hansson
2014-09-03 10:52 ` [PATCH 08/15] PM / Domains: Remove pm_genpd_syscore_switch() API Ulf Hansson
2014-09-03 10:52 ` [PATCH 09/15] PM / Domains: Remove genpd_queue_power_off_work() API Ulf Hansson
2014-09-03 10:52 ` [PATCH 10/15] PM / Domains: Add late_initcall to disable unused PM domains Ulf Hansson
2014-09-03 10:52 ` [PATCH 11/15] ARM: exynos: Leave disabling of unused PM domains to genpd Ulf Hansson
2014-09-03 10:52 ` [PATCH 12/15] ARM: s3c64xx: " Ulf Hansson
2014-09-03 10:52 ` [PATCH 13/15] drivers: sh: " Ulf Hansson
2014-09-04  0:33   ` Simon Horman
2014-09-05  8:23     ` Ulf Hansson
2014-09-03 10:52 ` [PATCH 14/15] PM / Domains: Remove default_stop_ok() API Ulf Hansson
2014-09-03 13:15   ` Geert Uytterhoeven
2014-09-04 19:49     ` Rafael J. Wysocki
2014-09-05  8:16       ` Ulf Hansson
2014-09-03 10:52 ` [PATCH 15/15] PM / Domains: Keep declaration of dev_power_governors together Ulf Hansson
2014-09-03 11:10 ` [PATCH 00/15] PM / Domains: Cleanups and remove superfluous APIs Arnd Bergmann
2014-09-04  8:40 ` Geert Uytterhoeven
2014-09-05 15:35 ` Kevin Hilman
2014-09-08 23:07   ` Rafael J. Wysocki
2014-09-09 15:05     ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409741551-16437-2-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).