From 17926551c98a4ff5d7fa3a574c60534fedb3f2c6 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 12 Sep 2016 12:01:14 +0100 Subject: PM / Domains: Add support for removing nested PM domains by provider If a device supports PM domains that are subdomains of another PM domain, then the PM domains should be removed in reverse order to ensure that the subdomains are removed first. Furthermore, if there is more than one provider, then there needs to be a way to remove the domains in reverse order for a specific provider. Add the function of_genpd_remove_last() to remove the last PM domain added by a given PM domain provider and return the generic_pm_domain structure for the PM domain that was removed. Signed-off-by: Jon Hunter Acked-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki --- include/linux/pm_domain.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 85f7d53..a09fe5c 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -204,6 +204,7 @@ extern int of_genpd_add_device(struct of_phandle_args *args, struct device *dev); extern int of_genpd_add_subdomain(struct of_phandle_args *parent, struct of_phandle_args *new_subdomain); +extern struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); int genpd_dev_pm_attach(struct device *dev); #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ @@ -237,6 +238,12 @@ static inline int genpd_dev_pm_attach(struct device *dev) { return -ENODEV; } + +static inline +struct generic_pm_domain *of_genpd_remove_last(struct device_node *np) +{ + return ERR_PTR(-ENOTSUPP); +} #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */ #ifdef CONFIG_PM -- cgit v1.1