summaryrefslogtreecommitdiffstats
path: root/include/pm_domain.h
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-01-19 17:25:53 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-01-22 11:12:02 +0100
commit1fb85a10c6c24c4fb367f047f46c75f7d3615330 (patch)
tree366cdc5985cd254108766686949949c47b2a3c87 /include/pm_domain.h
parentbea9e101e703efea0b46901c645f260ad9febb88 (diff)
downloadbarebox-1fb85a10c6c24c4fb367f047f46c75f7d3615330.tar.gz
barebox-1fb85a10c6c24c4fb367f047f46c75f7d3615330.tar.xz
pmdomain: use single implementation for dev_pm_domain_attach
genpd_dev_pm_attach already has a stub definition when !CONFIG_PM_GENERIC_DOMAINS, so we can just call it unconditionally from dev_pm_domain_attach. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240119162610.1014870-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/pm_domain.h')
-rw-r--r--include/pm_domain.h53
1 files changed, 24 insertions, 29 deletions
diff --git a/include/pm_domain.h b/include/pm_domain.h
index ac0ec477b6..bf122460d0 100644
--- a/include/pm_domain.h
+++ b/include/pm_domain.h
@@ -30,30 +30,6 @@ void genpd_activate(void);
int genpd_dev_pm_attach(struct device *dev);
-/**
- * dev_pm_domain_attach - Attach a device to its PM domain.
- * @dev: Device to attach.
- * @power_on: Used to indicate whether we should power on the device.
- *
- * The @dev may only be attached to a single PM domain. By iterating through
- * the available alternatives we try to find a valid PM domain for the device.
- * As attachment succeeds, the ->detach() callback in the struct dev_pm_domain
- * should be assigned by the corresponding attach function.
- *
- * This function should typically be invoked from subsystem level code during
- * the probe phase. Especially for those that holds devices which requires
- * power management through PM domains.
- *
- * Callers must ensure proper synchronization of this function with power
- * management callbacks.
- *
- * Returns 0 on successfully attached PM domain or negative error code.
- */
-static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
-{
- return genpd_dev_pm_attach(dev);
-}
-
int pm_genpd_init(struct generic_pm_domain *genpd, void *gov, bool is_off);
int of_genpd_add_provider_simple(struct device_node *np,
@@ -87,11 +63,6 @@ static inline int genpd_dev_pm_attach(struct device *dev)
return 0;
}
-static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
-{
- return 0;
-}
-
static inline int
of_genpd_add_provider_simple(struct device_node *np,
struct generic_pm_domain *genpd)
@@ -101,4 +72,28 @@ of_genpd_add_provider_simple(struct device_node *np,
#endif
+/**
+ * dev_pm_domain_attach - Attach a device to its PM domain.
+ * @dev: Device to attach.
+ * @power_on: Used to indicate whether we should power on the device.
+ *
+ * The @dev may only be attached to a single PM domain. By iterating through
+ * the available alternatives we try to find a valid PM domain for the device.
+ * As attachment succeeds, the ->detach() callback in the struct dev_pm_domain
+ * should be assigned by the corresponding attach function.
+ *
+ * This function should typically be invoked from subsystem level code during
+ * the probe phase. Especially for those that holds devices which requires
+ * power management through PM domains.
+ *
+ * Callers must ensure proper synchronization of this function with power
+ * management callbacks.
+ *
+ * Returns 0 on successfully attached PM domain or negative error code.
+ */
+static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
+{
+ return genpd_dev_pm_attach(dev);
+}
+
#endif